Skip to contentSkip to conversation

libnet: explicitly pass libnet_cv_have_packet_socket=yes because PF_PACKET is always available on Linux

PATCH New Joris Lijssens 2 participants 2 messages Nov 18, 2015 – Nov 19, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libnet: explicitly pass libnet_cv_have_packet_socket=yes because PF_PACKET is always available on Linux

---
 package/libnet/libnet.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/libnet/libnet.mk +5 -0
index 3b62a79..7004417 100644
@@ -10,4 +10,9 @@ LIBNET_INSTALL_STAGING = YES
 LIBNET_LICENSE = BSD-2c, BSD-3c
 LIBNET_LICENSE_FILES = doc/COPYING
 
+# PF_PACKET is always available on Linux, but build breaks for musl
+ifneq ($(BR2_TOOLCHAIN_USES_MUSL),y)
+LIBNET_CONF_OPTS = libnet_cv_have_packet_socket=yes
+endif
+
 $(eval $(autotools-package))
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/1 libnet: explicitly pass libnet_cv_have_packet_socket=yes because PF_PACKET is always available on Linux

Hello Joris,

Like your other patch, the commit title of this is too long. But there's another issue, read below.

Quoted 10 lines · Joris Lijssens
---
 package/libnet/libnet.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/libnet/libnet.mk +0 -0
index 3b62a79..7004417 100644

package/libnet/libnet.mk LIBNET_INSTALL_STAGING = YES · line 16

Quoted 7 lines
package/libnet/libnet.mk +4 -0
@@ -10,4 +10,9 @@ LIBNET_INSTALL_STAGING = YES
 LIBNET_LICENSE = BSD-2c, BSD-3c
 LIBNET_LICENSE_FILES = doc/COPYING
 
+# PF_PACKET is always available on Linux, but build breaks for musl
+ifneq ($(BR2_TOOLCHAIN_USES_MUSL),y)
+LIBNET_CONF_OPTS = libnet_cv_have_packet_socket=yes
+endif

In fact, even without defining libnet_cv_have_packet_socket=yes, libnet does not build with musl. So either the build problem should be fixed (it's a typical structure redefinition problem due to using the kernel headers instead of the C library headers), but it is not super simple to fix because libnet's code is somewhat convoluted.

I would suggest to simply mark the package as not available on musl (and therefore netsniff-ng as well). Can you send a patch doing this, and on top of this send a new version of this patch?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com