Patchwork [1/1] Fix build of VLAN_NETLINK.

login
register
mail settings
Submitter michael-dev@fami-braun.de
Date May 4, 2013, 1:53 p.m.
Message ID <5274997bb74b27a4daac77957e22da43@fami-braun.de>
Download mbox | patch
Permalink /patch/241462/
State Rejected
Headers show

Comments

michael-dev@fami-braun.de - May 4, 2013, 1:53 p.m.
Am 08.04.2013 22:40, schrieb Johannes Berg:
> On Mon, 2013-04-08 at 18:18 +0200, michael-dev@fami-braun.de wrote:
>> --- a/hostapd/Makefile
>> +++ b/hostapd/Makefile
>> @@ -129,6 +129,8 @@ ifdef CONFIG_FULL_DYNAMIC_VLAN
>>  OBJS += ../src/ap/vlan_util.o
>>  endif
>>  CFLAGS += -DCONFIG_VLAN_NETLINK
>> +CFLAGS += -I /usr/include/libnl3
>> +LIBS += -lnl-3 -lnl-genl-3 -lnl-route-3 -lnl-nf-3 -lnl-cli-3
> 
> That totally needs to be configurable, but there's probably already an
> option for it for nl80211.

The code enabled by this option already depends on libnl-3 headers and 
src/drivers/drivers.mk references /usr/include/libnl3 directly as well.
For example the code uses rtnl_link_set_type, which are undefined in 
libnl-1.1.3 and libnl2 (debian squeeze).

Would the following be better?

Regards,
  M. Braun

commit b4ef49518b9f534c5fe9ac0a1b0259dde8b25e17
Author: Michael Braun <michael-dev@fami-braun.de>
Date:   Mon Apr 8 11:58:23 2013 +0200

     Fix build of VLAN_NETLINK.

     Signed-hostap: Michael Braun <michael-dev@fami-braun.de>

debugging
Jouni Malinen - July 21, 2013, 10:12 a.m.
On Sat, May 04, 2013 at 03:53:31PM +0200, michael-dev wrote:
> Am 08.04.2013 22:40, schrieb Johannes Berg:
> >On Mon, 2013-04-08 at 18:18 +0200, michael-dev@fami-braun.de wrote:
> >>--- a/hostapd/Makefile
> >>+++ b/hostapd/Makefile
> >>@@ -129,6 +129,8 @@ ifdef CONFIG_FULL_DYNAMIC_VLAN
> >> OBJS += ../src/ap/vlan_util.o
> >> endif
> >> CFLAGS += -DCONFIG_VLAN_NETLINK
> >>+CFLAGS += -I /usr/include/libnl3
> >>+LIBS += -lnl-3 -lnl-genl-3 -lnl-route-3 -lnl-nf-3 -lnl-cli-3
> >
> >That totally needs to be configurable, but there's probably already an
> >option for it for nl80211.
> 
> The code enabled by this option already depends on libnl-3 headers
> and src/drivers/drivers.mk references /usr/include/libnl3 directly
> as well.
> For example the code uses rtnl_link_set_type, which are undefined in
> libnl-1.1.3 and libnl2 (debian squeeze).
> 
> Would the following be better?

Hmm.. Is this still an open issue? I'm failing to see what would be
needed here since src/drivers/drivers.mak is already adding the libnl3
libraries and the build works for me (on Ubuntu 12.04).

> diff --git a/hostapd/Makefile b/hostapd/Makefile
> @@ -129,6 +129,16 @@ ifdef CONFIG_FULL_DYNAMIC_VLAN
>  CFLAGS += -DCONFIG_VLAN_NETLINK
> +
> +# no LIBNL-1, LIBNL-2 or LIBNL-TINY support
> +ifdef CONFIG_LIBNL32
> +  LIBS += -lnl-3
> +  LIBS += -lnl-genl-3
> +  LIBS += -lnl-route-3
> +  LIBS += -lnl-nf-3
> +  CFLAGS += -I/usr/include/libnl3
> +endif

drivers.mak does not include nl-nf-3 but includes the other changes here
when CONFIG_VLAN_NETLINK and CONFIG_LIBNL32 are defined.


I'm dropping this patch now unless something new comes up with more
details on how the build is broken.

Patch

diff --git a/hostapd/Makefile b/hostapd/Makefile
index 26cc2b5..a47be88 100644
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
@@ -129,6 +129,16 @@  ifdef CONFIG_FULL_DYNAMIC_VLAN
  OBJS += ../src/ap/vlan_util.o
  endif
  CFLAGS += -DCONFIG_VLAN_NETLINK
+
+# no LIBNL-1, LIBNL-2 or LIBNL-TINY support
+ifdef CONFIG_LIBNL32
+  LIBS += -lnl-3
+  LIBS += -lnl-genl-3
+  LIBS += -lnl-route-3
+  LIBS += -lnl-nf-3
+  CFLAGS += -I/usr/include/libnl3
+endif
+
  endif
  endif

diff --git a/hostapd/defconfig b/hostapd/defconfig
index 317fe74..59f2742 100644
--- a/hostapd/defconfig
+++ b/hostapd/defconfig
@@ -170,6 +170,7 @@  CONFIG_IPV6=y
  # Use netlink-based kernel API for VLAN operations instead of ioctl()
  # Note: This requires libnl 3.1 or newer.
  #CONFIG_VLAN_NETLINK=y
+#CONFIG_LIBNL32=y

  # Remove support for dumping state into a file on SIGUSR1 signal
  # This can be used to reduce binary size at the cost of disabling a