shill: Use libnl3
Small changes required to build with libnl3.
TEST=Compiles, Config80211 still recieves messages
BUG=chromium-os:36122
CQ-DEPEND=I13ab6e2d835fc63bafc5af3d9c3890505ba49d46
Change-Id: I9eeb02378b81faab0cdd790d21f91f8be57fb681
Reviewed-on: https://gerrit.chromium.org/gerrit/37673
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Christopher Wiley <wiley@chromium.org>
diff --git a/Makefile b/Makefile
index 3d6198a..8754c3d 100644
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,8 @@
gio-2.0 \
glib-2.0 \
ModemManager \
- libnl-1
+ libnl-3.0 \
+ libnl-genl-3.0
NSS_GET_CERT_PC_DEPS = $(COMMON_PC_DEPS) nss
OPENVPN_SCRIPT_PC_DEPS = $(COMMON_PC_DEPS) dbus-c++-1
PPPD_PLUGIN_PC_DEPS = $(COMMON_PC_DEPS) dbus-c++-1
diff --git a/netlink_socket.h b/netlink_socket.h
index a698db3..7abc271 100644
--- a/netlink_socket.h
+++ b/netlink_socket.h
@@ -43,20 +43,6 @@
namespace shill {
-// libnl 1.x compatibility code -- these functions provide libnl v2.x/v3.x
-// interfaces for systems that only have v1.x libraries.
-#if !defined(CONFIG_LIBNL20) && !defined(CONFIG_LIBNL30)
-#define nl_sock nl_handle
-static inline struct nl_handle *nl_socket_alloc(void) {
- return nl_handle_alloc();
-}
-
-static inline void nl_socket_free(struct nl_sock *h) {
- nl_handle_destroy(h);
-}
-#endif /* CONFIG_LIBNL20 && CONFIG_LIBNL30 */
-
-
// Provides an abstraction to a netlink socket. See
// http://www.infradead.org/~tgr/libnl/ for documentation on how netlink
// sockets work.
diff --git a/user_bound_nlmessage.cc b/user_bound_nlmessage.cc
index 7121512..62eb59c 100644
--- a/user_bound_nlmessage.cc
+++ b/user_bound_nlmessage.cc
@@ -1977,7 +1977,7 @@
<< "k" << message.GetMessageTypeString()
<< "[] = {";
- int payload_bytes = nlmsg_len(msg);
+ int payload_bytes = nlmsg_datalen(msg);
size_t bytes = nlmsg_total_size(payload_bytes);
unsigned char *rawdata = reinterpret_cast<unsigned char *>(msg);