diff mbox

wpa_supplicant: fix libnl-tiny support

Message ID 20160223205343.4aafe7aafb10b00fc95f8d1c@dimakrasner.com
State Changes Requested
Headers show

Commit Message

Dima Krasner Feb. 23, 2016, 6:53 p.m. UTC
Signed-off-by: Dima Krasner <dima@dimakrasner.com>
---
 src/drivers/driver_nl80211.c | 7 +++++++
 src/drivers/drivers.mak      | 2 ++
 2 files changed, 9 insertions(+)

Comments

Johannes Berg March 2, 2016, 2 p.m. UTC | #1
On Tue, 2016-02-23 at 20:53 +0200, Dima Krasner wrote:
> Signed-off-by: Dima Krasner <dima@dimakrasner.com>
> ---
>  src/drivers/driver_nl80211.c | 7 +++++++
>  src/drivers/drivers.mak      | 2 ++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/src/drivers/driver_nl80211.c
> b/src/drivers/driver_nl80211.c
> index 5fec430..937cb0c 100644
> --- a/src/drivers/driver_nl80211.c
> +++ b/src/drivers/driver_nl80211.c
> @@ -39,6 +39,13 @@
>  #include "driver_nl80211.h"
>  
>  
> +#ifdef CONFIG_LIBNL_TINY
> +#define nl_handle nl_sock
> +#define nl_handle_alloc_cb nl_socket_alloc_cb
> +#define nl_handle_destroy nl_socket_free
> +#endif
> 

Same comment as on the iw patch - you're doing this in a very
roundabout way; the code already has the ability to deal with libnl 1.1
(or compatible) API, so you don't need to redefine everything afaict.

johannes
Jouni Malinen March 4, 2016, 6:36 p.m. UTC | #2
On Tue, Feb 23, 2016 at 08:53:43PM +0200, Dima Krasner wrote:
> diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
> @@ -39,6 +39,13 @@
>  #include "driver_nl80211.h"
>  
>  
> +#ifdef CONFIG_LIBNL_TINY
> +#define nl_handle nl_sock
> +#define nl_handle_alloc_cb nl_socket_alloc_cb
> +#define nl_handle_destroy nl_socket_free
> +#endif

Which version of libnl-tiny are you using and which version of
wpa_supplicant? I don't see how this could fix anything since other
driver_nl80211*.c files would need similar definitions. And in any case,
you should share the existing defines in driver_nl80211.h with
CONFIG_LIBNL20=y if the libnl-tiny version you are using happens to be
using the libnl v2.0 API.
diff mbox

Patch

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 5fec430..937cb0c 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -39,6 +39,13 @@ 
 #include "driver_nl80211.h"
 
 
+#ifdef CONFIG_LIBNL_TINY
+#define nl_handle nl_sock
+#define nl_handle_alloc_cb nl_socket_alloc_cb
+#define nl_handle_destroy nl_socket_free
+#endif
+
+
 #ifndef CONFIG_LIBNL20
 /*
  * libnl 1.1 has a bug, it tries to allocate socket numbers densely
diff --git a/src/drivers/drivers.mak b/src/drivers/drivers.mak
index c4f5f97..d3b8185 100644
--- a/src/drivers/drivers.mak
+++ b/src/drivers/drivers.mak
@@ -56,6 +56,7 @@  endif
 else
   ifdef CONFIG_LIBNL_TINY
     DRV_LIBS += -lnl-tiny
+    DRV_CFLAGS += -DCONFIG_LIBNL_TINY
   else
     ifndef CONFIG_OSX
       DRV_LIBS += -lnl
@@ -172,6 +173,7 @@  ifdef CONFIG_LIBNL32
 else
   ifdef CONFIG_LIBNL_TINY
     DRV_LIBS += -lnl-tiny
+    DRV_CFLAGS += -DCONFIG_LIBNL_TINY
   else
     DRV_LIBS += -lnl
   endif