From 05a44ed591ee4dbb3f903c9ed2a962a5b60ca3b0 Mon Sep 17 00:00:00 2001 From: Jaroslav Škarvada Date: Mar 06 2017 12:46:36 +0000 Subject: Dropped GENL_ID_GENERATE to fix compilation with kernel 4.10+ --- diff --git a/netsniff-ng-0.6.2-drop-genl-id-generate.patch b/netsniff-ng-0.6.2-drop-genl-id-generate.patch new file mode 100644 index 0000000..65c2ea7 --- /dev/null +++ b/netsniff-ng-0.6.2-drop-genl-id-generate.patch @@ -0,0 +1,45 @@ +From 88ec2ad37cabb3d3b7ca0e8e5ea3d682c083618d Mon Sep 17 00:00:00 2001 +From: Tobias Klauser +Date: Mon, 6 Mar 2017 12:22:57 +0100 +Subject: [PATCH] netsniff-ng: nlmsg: Drop dissection of GENL_ID_GENERATE type +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +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 +Signed-off-by: Tobias Klauser +--- + proto_nlmsg.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/proto_nlmsg.c b/proto_nlmsg.c +index f8993e7..f206405 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"; + } + } + diff --git a/netsniff-ng.spec b/netsniff-ng.spec index b9f82f3..7944ff1 100644 --- a/netsniff-ng.spec +++ b/netsniff-ng.spec @@ -6,6 +6,8 @@ Group: Applications/Internet License: GPLv2 URL: http://netsniff-ng.org/ Source0: http://www.netsniff-ng.org/pub/netsniff-ng/netsniff-ng-%{version}.tar.xz +# https://github.com/netsniff-ng/netsniff-ng/issues/171 +Patch0: netsniff-ng-0.6.2-drop-genl-id-generate.patch BuildRequires: ncurses-devel GeoIP-devel libnetfilter_conntrack-devel BuildRequires: userspace-rcu-devel libnl3-devel libcli-devel flex bison BuildRequires: perl-podlators zlib-devel libpcap-devel libnet-devel @@ -32,6 +34,7 @@ netsniff-ng toolkit currently consists of the following utilities: %prep %setup -q +%patch0 -p1 -b .drop-genl-id-generate %build export NACL_INC_DIR=$(pkg-config --variable=includedir libsodium )/sodium @@ -54,6 +57,9 @@ make install PREFIX=%{_prefix} ETCDIR=%{_sysconfdir} DESTDIR="%{buildroot}" %{_mandir}/man8/* %changelog +* Mon Mar 6 2017 Jaroslav Škarvada - 0.6.2-2 +- Dropped GENL_ID_GENERATE to fix compilation with kernel 4.10+ + * Fri Feb 10 2017 Fedora Release Engineering - 0.6.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild