Skip to contentSkip to conversation

netsniff-ng: fix build with kernel headers v4.10+

PATCH New Baruch Siach 3 participants 4 messages Mar 10, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 netsniff-ng: fix build with kernel headers v4.10+

Add upstream patch removing use of GENL_ID_GENERATE that was dropped in kernel version 4.10.

Fixes:
http://autobuild.buildroot.net/results/58d/58d7809cae739f728c58291f2111684d6c0578f3/
http://autobuild.buildroot.net/results/65c/65ce9807116ca70908e0aabae59a36c7774dfa7a/
http://autobuild.buildroot.net/results/64b/64b3f8af2ebc5a14ecbef72039ef527b5d71f12c/

Cc Joris Lijssens <[email protected]>
---
 ...-nlmsg-Drop-dissection-of-GENL_ID_GENERAT.patch | 48 ++++++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 package/netsniff-ng/0001-netsniff-ng-nlmsg-Drop-dissection-of-GENL_ID_GENERAT.patch
package/netsniff-ng/0001-netsniff-ng-nlmsg-Drop-dissection-of-GENL_ID_GENERAT.patch new file +48 -0
new file mode 100644
index 000000000000..4ccf9d643c16
@@ -0,0 +1,48 @@
+From 88ec2ad37cabb3d3b7ca0e8e5ea3d682c083618d Mon Sep 17 00:00:00 2001
+From: Tobias Klauser <[email protected]>
+Date: Mon, 6 Mar 2017 12:22:57 +0100
+Subject: [PATCH] netsniff-ng: nlmsg: Drop dissection of GENL_ID_GENERATE type
+
+After kernel commit a07ea4d9941a ("genetlink: no longer support using
+static family IDs"), GENL_ID_GENERATE is no longer exposed to userspace
+(and actually should never have been). Change the genl nlmsg dissector
+to only consider the nlctrl family and the two other static family IDs
+needed for workarounds. All other family IDs are considered dynamically
+generated.
+
+Fixes #171
+Reported-by: Jaroslav ?karvada <[email protected]>
+Signed-off-by: Tobias Klauser <[email protected]>
+Signed-off-by: Baruch Siach <[email protected]>
+---
+Patch status: upstream commit 88ec2ad37cabb
+
+ proto_nlmsg.c | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/proto_nlmsg.c b/proto_nlmsg.c
+index f8993e794a54..f2064059be08 100644
+--- a/proto_nlmsg.c
++++ b/proto_nlmsg.c
+@@ -242,9 +242,15 @@ static const char *nlmsg_rtnl_type2str(uint16_t type)
+ static const char *nlmsg_genl_type2str(uint16_t type)
+ {
+ 	switch (type) {
+-	case GENL_ID_GENERATE:	return "id gen";
+-	case GENL_ID_CTRL:	return "id ctrl";
+-	default:		return NULL;
++	case GENL_ID_CTRL:	return "nlctrl";
++#if defined(GENL_ID_PCMRAID)
++	case GENL_ID_PCMRAID:	return "pcmraid";
++#endif
++#if defined(GENL_ID_VFS_DQUOT)
++	case GENL_ID_VFS_DQUOT:	return "vfs dquot";
++#endif
++	/* only dynamic family IDs should be used starting with Linux 4.10 */
++	default:		return "dynamic";
+ 	}
+ }
+ 
+-- 
+2.11.0
+
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/2 netsniff-ng: add homepage link

Cc Joris Lijssens <[email protected]>
---
 package/netsniff-ng/Config.in | 2 ++
 1 file changed, 2 insertions(+)
package/netsniff-ng/Config.in +2 -0
index 00617e371921..b59c876a9927 100644
@@ -16,6 +16,8 @@ config BR2_PACKAGE_NETSNIFF_NG
 	  networking toolkit. If you will, the Swiss army knife for
 	  network packets.
 
+	  http://netsniff-ng.org
+
 comment "netsniff-ng needs a glibc or musl toolchain w/ threads, headers >= 3.0"
 	depends on BR2_PACKAGE_LIBURCU_ARCH_SUPPORTS
 	depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_TOOLCHAIN_USES_UCLIBC \
Signature · 1 line
2.11.0
#2 lore raw

PATCH 1/2 netsniff-ng: fix build with kernel headers v4.10+

In reply to Baruch Siach

Hello,

Quoted 8 lines · Baruch Siach

Add upstream patch removing use of GENL_ID_GENERATE that was dropped in kernel version 4.10.

Fixes:
http://autobuild.buildroot.net/results/58d/58d7809cae739f728c58291f2111684d6c0578f3/
http://autobuild.buildroot.net/results/65c/65ce9807116ca70908e0aabae59a36c7774dfa7a/
http://autobuild.buildroot.net/results/64b/64b3f8af2ebc5a14ecbef72039ef527b5d71f12c/

Quoted 6 lines
Cc Joris Lijssens <[email protected]>
---
 ...-nlmsg-Drop-dissection-of-GENL_ID_GENERAT.patch | 48 ++++++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 package/netsniff-ng/0001-netsniff-ng-nlmsg-Drop-dissection-of-GENL_ID_GENERAT.patch

Both applied to master, thanks!

Peter: do we want to fix a build issue related to 4.10 kernel headers in the LTS version? The LTS version did not have explicit support for 4.10 kernel headers, so I'm not sure it's really worth the effort.

Thomas

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

PATCH 1/2 netsniff-ng: fix build with kernel headers v4.10+

Quoted 19 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hello,

Quoted 8 lines · Baruch Siach

Add upstream patch removing use of GENL_ID_GENERATE that was dropped in kernel version 4.10.

Fixes:
http://autobuild.buildroot.net/results/58d/58d7809cae739f728c58291f2111684d6c0578f3/
http://autobuild.buildroot.net/results/65c/65ce9807116ca70908e0aabae59a36c7774dfa7a/
http://autobuild.buildroot.net/results/64b/64b3f8af2ebc5a14ecbef72039ef527b5d71f12c/

Quoted 6 lines
Cc Joris Lijssens <[email protected]>

---
...-nlmsg-Drop-dissection-of-GENL_ID_GENERAT.patch | 48 ++++++++++++++++++++++

1 file changed, 48 insertions(+)

create mode 100644 package/netsniff-ng/0001-netsniff-ng-nlmsg-Drop-dissection-of-GENL_ID_GENERAT.patch

Quoted 5 lines

Both applied to master, thanks!

Peter: do we want to fix a build issue related to 4.10 kernel headers in the LTS version? The LTS version did not have explicit support for 4.10 kernel headers, so I'm not sure it's really worth the effort.

While the patch is quite small and safe looking, as we don't have official 4.10 headers support I don't think it makes sense to add it to 2017.02.x.

Signature · 1 line
Bye, Peter Korsgaard