Skip to contentSkip to conversation

package/iptables: add option to enabel libipq build

RFC In review Peter Seiderer 2 participants 4 messages Jun 20, 2021 – Jul 27, 2021

lore
Share & tools
lore
#0 lore raw

RFC 1/2 package/iptables: add option to enabel libipq build

- add option to enable libipq build
- as libipq.h includes linux/netfilter_ipv4/ip_queue.h install (not provided by modern kernels otherwise?)

---
 package/iptables/Config.in   |  5 +++++
 package/iptables/iptables.mk | 10 ++++++++++
 2 files changed, 15 insertions(+)
package/iptables/Config.in +5 -0
index e6b12603e0..0aacf06c03 100644
@@ -7,6 +7,11 @@ config BR2_PACKAGE_IPTABLES
 
 if BR2_PACKAGE_IPTABLES
 
+config BR2_PACKAGE_IPTABLES_LIBIPQ
+	bool "libipq"
+	help
+	  Build libipq.
+
 config BR2_PACKAGE_IPTABLES_BPF_NFSYNPROXY
 	bool "bpfc and nfsynproxy"
 	select BR2_PACKAGE_LIBPCAP
package/iptables/iptables.mk +10 -0
index ca8178425e..227b485d43 100644
@@ -29,6 +29,16 @@ ifeq ($(BR2_PACKAGE_LIBNFNETLINK),y)
 IPTABLES_DEPENDENCIES += libnfnetlink
 endif
 
+ifeq ($(BR2_PACKAGE_IPTABLES_LIBIPQ),y)
+IPTABLES_CONF_OPTS += --enable-libipq
+define IPTABLES_INSTALL_LIBIPQ_HEADERS_CMD
+	$(INSTALL) -m 0644 -D $(@D)/include/linux/netfilter_ipv4/ip_queue.h $(STAGING_DIR)/usr/include/linux/netfilter_ipv4/ip_queue.h
+endef
+IPTABLES_POST_INSTALL_STAGING_HOOKS += IPTABLES_INSTALL_LIBIPQ_HEADERS_CMD
+else
+IPTABLES_CONF_OPTS += --disable-libipq
+endif
+
 # For iptables-compat tools
 ifeq ($(BR2_PACKAGE_IPTABLES_NFTABLES),y)
 IPTABLES_CONF_OPTS += --enable-nftables
Signature · 1 line
2.31.1
#1 lore raw

RFC 2/2 package/nrlsmf: new package

- use src-nrlsmf-with-protolib-1.1b2a.tgz download (instead of plain git one) with bundled protolib as nrlsmf does not compile with an up to date protolib version

- needs thread support (pthread.h)

- select BR2_PACKAGE_IPTABLES_LIBIPQ to gain access to header linux/netfilter_ipv4/ip_queue.h

- overwrite CFLAGS to re-add nrlsmf specific include paths and defines (taken from unix/Makefile.common and unix/Makefile.linux)

- add -fpmerissive to avoid build error

- overwrite SYSTEM_LIBS to avoid libpcap linking

- overwrite CC to link usign g++ (instead of gcc, fixes linking error because of missing C++ libs)

---
 DEVELOPERS                 |  1 +
 package/Config.in          |  1 +
 package/nrlsmf/Config.in   | 15 ++++++++++++++
 package/nrlsmf/nrlsmf.hash |  3 +++
 package/nrlsmf/nrlsmf.mk   | 42 ++++++++++++++++++++++++++++++++++++++
 5 files changed, 62 insertions(+)
 create mode 100644 package/nrlsmf/Config.in
 create mode 100644 package/nrlsmf/nrlsmf.hash
 create mode 100644 package/nrlsmf/nrlsmf.mk
DEVELOPERS +1 -0
index f6621e9670..2761d6ccfa 100644
@@ -2148,6 +2148,7 @@ F:	package/iwd/
 F:	package/libevdev/
 F:	package/libuev/
 F:	package/log4cplus/
+F:	package/nrlsmf/
 F:	package/postgresql/
 F:	package/python-colorzero/
 F:	package/python-flask-wtf/
package/Config.in +1 -0
index cb8ece4919..c340ae515f 100644
@@ -2232,6 +2232,7 @@ endif
 	source "package/nload/Config.in"
 	source "package/nmap/Config.in"
 	source "package/noip/Config.in"
+	source "package/nrlsmf/Config.in"
 	source "package/ntp/Config.in"
 	source "package/nuttcp/Config.in"
 	source "package/odhcp6c/Config.in"
package/nrlsmf/Config.in new file +15 -0
new file mode 100644
index 0000000000..61feba2ef6
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_NRLSMF
+	bool "nrlsmf"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	select BR2_PACKAGE_IPTABLES
+	select BR2_PACKAGE_IPTABLES_LIBIPQ # header linux/netfilter_ipv4/ip_queue.h
+	help
+	  The NRL Simplified Multicast Forwarding (nrlsmf) project is a
+	  user-space software implementation of the forwarding engine
+	  for Simplified Multicast Forwarding (SMF, RFC 6621).
+
+	  https://www.nrl.navy.mil/Our-Work/Areas-of-Research/Information-Technology/NCS/SMF
+
+comment "nrlsmf needs a toolchain w/ C++, threads"
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
package/nrlsmf/nrlsmf.hash new file +3 -0
new file mode 100644
index 0000000000..9d066c6f0c
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  d72f0ea8d12d19ee30cbbbf96bcfc9d5f57c4e2d11fe0e336a4e8005fef7c5b0  src-nrlsmf-with-protolib-1.1b2a.tgz
+sha256  8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903  COPYING
package/nrlsmf/nrlsmf.mk new file +42 -0

42 lines not on this page · raw message

Signature · 1 line
2.31.1
#2 lore raw
In reply to Peter Seiderer
Quoted 5 lines · On Sun, 20 Jun 2021 22:56:06 +0200 Peter Seiderer <[email protected]> wrote:

- add option to enable libipq build
- as libipq.h includes linux/netfilter_ipv4/ip_queue.h install (not provided by modern kernels otherwise?)

Is it really a good idea to add an option for this library?

Debian dropped installing libipq 5 years ago, as this library is deprecated:

https://salsa.debian.org/pkg-netfilter-team/pkg-iptables/-/commit/bf21537d27ee72cc69ca0883059b315ceaf9737d

Also in 2012, iptables developers said they would keep this library for 1.5-2 years:

https://git.netfilter.org/iptables/commit/?id=a624e0a1b2d075253b599ababd4ea1351ef42b2a

But then, when I look at the nrlsmf source code, I don't see any reference to libipq or ip_queue.h. Am I missing something ?

Thanks,

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot
#3 lore raw

Hello Thomas,

Quoted 14 lines · Thomas Petazzoni
Quoted 5 lines · On Sun, 20 Jun 2021 22:56:06 +0200 Peter Seiderer <[email protected]> wrote:

- add option to enable libipq build
- as libipq.h includes linux/netfilter_ipv4/ip_queue.h install (not provided by modern kernels otherwise?)

Is it really a good idea to add an option for this library?

Debian dropped installing libipq 5 years ago, as this library is deprecated:

Quoted 6 lines

https://salsa.debian.org/pkg-netfilter-team/pkg-iptables/-/commit/bf21537d27ee72cc69ca0883059b315ceaf9737d

Also in 2012, iptables developers said they would keep this library for 1.5-2 years:

https://git.netfilter.org/iptables/commit/?id=a624e0a1b2d075253b599ababd4ea1351ef42b2a

Did the patch as part of porting an custom (very ancient ubuntu based) project to up-to-date buildroot, but hope to get rid of all legacy dependencies on the long run..., no problem with dropping this patch...

Quoted 3 lines

But then, when I look at the nrlsmf source code, I don't see any reference to libipq or ip_queue.h. Am I missing something ?

File smf-1.1b2/protolib/unix/linuxDetour.cpp:
15 #include <linux/netfilter_ipv4/ip_queue.h>

Mhhh, maybe I mistake it because of the ip_queue.h file found in libipq...

No problem dropping this patch, see above ;-)

Regards,
Peter

Quoted 4 lines

Thanks,

Thomas

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot