aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-12-08 22:40:58 +0200
committerJouni Malinen <j@w1.fi>2008-12-08 22:40:58 +0200
commit205a372b2d1625210751de946df3a3280fe8ba22 (patch)
tree65684fb6bbc71ca32e996ec2bfa5338bfefe7d74 /hostapd
parent13d9817dd02a2d83332d42ddb67cda1dd9685f0c (diff)
downloadexternal_wpa_supplicant_8_ti-205a372b2d1625210751de946df3a3280fe8ba22.zip
external_wpa_supplicant_8_ti-205a372b2d1625210751de946df3a3280fe8ba22.tar.gz
external_wpa_supplicant_8_ti-205a372b2d1625210751de946df3a3280fe8ba22.tar.bz2
Added libnl 2.0 compatibility code (CONFIG_LIBNL20=y in .config needed)
Unfortunately, at least the current libnl git snapshot changes the API in backwards incompatible way and in a way that makes it difficult to to allow building against the latest libnl code.
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/Makefile4
-rw-r--r--hostapd/driver_nl80211.c13
2 files changed, 17 insertions, 0 deletions
diff --git a/hostapd/Makefile b/hostapd/Makefile
index 5061413..666f91c 100644
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
@@ -125,6 +125,10 @@ ifdef CONFIG_DRIVER_NL80211
CFLAGS += -DCONFIG_DRIVER_NL80211
OBJS += driver_nl80211.o radiotap.o
LIBS += -lnl
+ifdef CONFIG_LIBNL20
+LIBS += -lnl-genl
+CFLAGS += -DCONFIG_LIBNL20
+endif
endif
ifdef CONFIG_DRIVER_BSD
diff --git a/hostapd/driver_nl80211.c b/hostapd/driver_nl80211.c
index e59f5cd..496b179 100644
--- a/hostapd/driver_nl80211.c
+++ b/hostapd/driver_nl80211.c
@@ -40,6 +40,12 @@
#include "radiotap.h"
#include "radiotap_iter.h"
+#ifdef CONFIG_LIBNL20
+/* libnl 2.0 compatibility code */
+#define nl_handle_alloc_cb nl_socket_alloc_cb
+#define nl_handle_destroy nl_socket_free
+#endif /* CONFIG_LIBNL20 */
+
enum ieee80211_msg_type {
ieee80211_msg_normal = 0,
ieee80211_msg_tx_callback_ack = 1,
@@ -2044,11 +2050,18 @@ static int i802_init_sockets(struct i802_driver_data *drv, const u8 *bssid)
return -1;
}
+#ifdef CONFIG_LIBNL20
+ if (genl_ctrl_alloc_cache(drv->nl_handle, &drv->nl_cache) < 0) {
+ printf("Failed to allocate generic netlink cache.\n");
+ return -1;
+ }
+#else /* CONFIG_LIBNL20 */
drv->nl_cache = genl_ctrl_alloc_cache(drv->nl_handle);
if (!drv->nl_cache) {
printf("Failed to allocate generic netlink cache.\n");
return -1;
}
+#endif /* CONFIG_LIBNL20 */
drv->nl80211 = genl_ctrl_search_by_name(drv->nl_cache, "nl80211");
if (!drv->nl80211) {