aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.in1
-rw-r--r--ws80211_utils.c14
2 files changed, 15 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index a6724d1952..ad6c733e71 100644
--- a/configure.in
+++ b/configure.in
@@ -249,6 +249,7 @@ elif (test "${have_libnl1}" = "yes"); then
CFLAGS="$CFLAGS $LIBNL1_CFLAGS"
LIBS="$LIBS $LIBNL1_LIBS"
AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
+ AC_DEFINE(HAVE_LIBNL1, 1, [libnl version 1])
libnl_message="yes (v1)"
enable_airpcap=no
fi
diff --git a/ws80211_utils.c b/ws80211_utils.c
index 6c100d4b98..3c7ea73d66 100644
--- a/ws80211_utils.c
+++ b/ws80211_utils.c
@@ -47,6 +47,20 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <netlink/msg.h>
#include <netlink/attr.h>
+/* libnl 1.x compatibility code */
+#ifdef HAVE_LIBNL1
+#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 /* HAVE_LIBNL1 */
+
struct nl80211_state {
struct nl_sock *nl_sock;
int nl80211_id;