[gentoo-commits] repo/gentoo:master commit in: net-firewall/ipt_netflow/, net-firewall/ipt_netflow/files/

2024-01-19 Thread Sergey Popov
commit: a5debd13910f26e1a5c3e1d025f3bb79b3d52613
Author: Sergey Popov  gentoo  org>
AuthorDate: Fri Jan 19 12:20:57 2024 +
Commit: Sergey Popov  gentoo  org>
CommitDate: Fri Jan 19 12:22:29 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a5debd13

net-firewall/ipt_netflow: fix build with kernel 6.4

Closes: https://bugs.gentoo.org/921589
Reported-by: Aurelien Minet  free.fr>
Signed-off-by: Sergey Popov  gentoo.org>

 .../files/ipt_netflow-2.6-kernel-6.4.patch | 66 ++
 net-firewall/ipt_netflow/ipt_netflow-2.6-r1.ebuild |  4 +-
 2 files changed, 68 insertions(+), 2 deletions(-)

diff --git a/net-firewall/ipt_netflow/files/ipt_netflow-2.6-kernel-6.4.patch 
b/net-firewall/ipt_netflow/files/ipt_netflow-2.6-kernel-6.4.patch
new file mode 100644
index ..cfbca8823d79
--- /dev/null
+++ b/net-firewall/ipt_netflow/files/ipt_netflow-2.6-kernel-6.4.patch
@@ -0,0 +1,66 @@
+From 0eb2092e930c78fc726d5d05abbcc81aa6c41b89 Mon Sep 17 00:00:00 2001
+From: ABC 
+Date: Mon, 26 Jun 2023 16:29:58 -0300
+Subject: [PATCH] Build compatibility with v6.4 (register_sysctl_paths)
+
+'register_sysctl_paths' is missed from v6.4 due to 0199849acd07
+("sysctl: remove register_sysctl_paths()").
+
+Signed-off-by: ABC 
+
+Slightly modified to fit on 2.6 release
+---
+ gen_compat_def |  2 ++
+ ipt_NETFLOW.c  | 10 --
+ 2 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/gen_compat_def b/gen_compat_def
+index 396fdb9..a9cb95e 100755
+--- a/gen_compat_def
 b/gen_compat_def
+@@ -87,6 +87,8 @@
+ kbuild_test_symbol nf_bridge_info_get linux/netfilter_bridge.h
+ # Stumbled on 5.9
+ kbuild_test_struct vlan_dev_priv linux/if_vlan.h
++# 6.4: 0199849acd07 ("sysctl: remove register_sysctl_paths()")
++kbuild_test_symbol register_sysctl_paths linux/sysctl.h
+ 
+ echo "// End of compat_def.h"
+ 
+diff --git a/ipt_NETFLOW.c b/ipt_NETFLOW.c
+index b3c2c99..eee8074 100644
+--- a/ipt_NETFLOW.c
 b/ipt_NETFLOW.c
+@@ -1929,16 +1929,18 @@ static ctl_table netflow_net_table[] = {
+   { }
+ };
+ #else /* >= 2.6.25 */
++# ifdef HAVE_REGISTER_SYSCTL_PATHS
+ static struct ctl_path netflow_sysctl_path[] = {
+   {
+   .procname = "net",
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
++#  if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
+   .ctl_name = CTL_NET
+-#endif
++#  endif
+   },
+   { .procname = "netflow" },
+   { }
+ };
++# endif
+ #endif /* 2.6.25 */
+ #endif /* CONFIG_SYSCTL */
+ 
+@@ -5666,7 +5668,11 @@ static int __init ipt_netflow_init(void)
+ #endif
+ );
+ #else /* 2.6.25 */
++# ifdef HAVE_REGISTER_SYSCTL_PATHS
+   netflow_sysctl_header = register_sysctl_paths(netflow_sysctl_path, 
netflow_sysctl_table);
++# else
++  netflow_sysctl_header = register_sysctl("net/netflow", 
netflow_sysctl_table);
++# endif
+ #endif
+   if (!netflow_sysctl_header) {
+   printk(KERN_ERR "netflow: can't register to sysctl\n");

diff --git a/net-firewall/ipt_netflow/ipt_netflow-2.6-r1.ebuild 
b/net-firewall/ipt_netflow/ipt_netflow-2.6-r1.ebuild
index 5cbcfb78c715..08997f3178c2 100644
--- a/net-firewall/ipt_netflow/ipt_netflow-2.6-r1.ebuild
+++ b/net-firewall/ipt_netflow/ipt_netflow-2.6-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -33,7 +33,7 @@ PATCHES=(
"${FILESDIR}/${PN}-2.6-gentoo.patch"
"${FILESDIR}/${P}-ref_module_fix.patch" # bug #781014
"${FILESDIR}/${P}-fix-linux-headers-5.14.patch" # bug #813993
-
+   "${FILESDIR}/${P}-kernel-6.4.patch" # bug #921589
 )
 
 pkg_setup() {



[gentoo-commits] repo/gentoo:master commit in: net-firewall/ipt_netflow/, net-firewall/ipt_netflow/files/

2023-06-27 Thread Sergey Popov
commit: 7c8a3effadf1997628b137b7855a1f4e1fe5f969
Author: Sergey Popov  gentoo  org>
AuthorDate: Tue Jun 27 08:55:47 2023 +
Commit: Sergey Popov  gentoo  org>
CommitDate: Tue Jun 27 08:58:06 2023 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c8a3eff

net-firewall/ipt_netflow: revision bump

Bump EAPI to 8. Migrate to linux-mod-r1 eclass
Sync live ebuild
Add missing remote-id in metadata.xml

Signed-off-by: Sergey Popov  gentoo.org>

 .../files/ipt_netflow--gentoo.patch| 15 -
 ...tflow-.ebuild => ipt_netflow-2.6-r1.ebuild} | 36 --
 net-firewall/ipt_netflow/ipt_netflow-.ebuild   | 18 +--
 net-firewall/ipt_netflow/metadata.xml  |  1 +
 4 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/net-firewall/ipt_netflow/files/ipt_netflow--gentoo.patch 
b/net-firewall/ipt_netflow/files/ipt_netflow--gentoo.patch
index 675e8b16f725..de797495f0fd 100644
--- a/net-firewall/ipt_netflow/files/ipt_netflow--gentoo.patch
+++ b/net-firewall/ipt_netflow/files/ipt_netflow--gentoo.patch
@@ -1,6 +1,6 @@
 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -11,7 +11,7 @@ CARGS = @CARGS@
+@@ -13,7 +13,7 @@ CARGS = @CARGS@
  SNMPTGSO = /usr/lib/snmp/dlmod/snmp_NETFLOW.so
  SNMPCONF = /etc/snmp/snmpd.conf
  SNMPLINE = dlmod netflow $(SNMPTGSO)
@@ -9,15 +9,16 @@
  
  # https://www.kernel.org/doc/Documentation/kbuild/modules.txt
  # https://www.kernel.org/doc/Documentation/kbuild/makefiles.txt
-@@ -22,31 +22,31 @@ all: ipt_NETFLOW.ko libipt_NETFLOW.so libip6t_NETFLOW.so 
@SNMPTARGET@
+@@ -24,7 +24,7 @@
  
  ipt_NETFLOW.ko: version.h ipt_NETFLOW.c ipt_NETFLOW.h compat_def.h compat.h 
Makefile
-   @echo Compiling for kernel $(KVERSION)
--  make -C $(KDIR) M=$(CURDIR) modules CONFIG_DEBUG_INFO=y
-+  $(MAKE) -C $(KDIR) M=$(CURDIR) modules CONFIG_DEBUG_INFO=y
+   @echo Compiling $(shell ./version.sh) for kernel $(KVERSION)
+-  make -C $(KDIR) M=$(CURDIR) modules
++  $(MAKE) -C $(KDIR) M=$(CURDIR) modules
@touch $@
  compat_def.h: gen_compat_def
-   ./gen_compat_def > $@
+   ./gen_compat_def > $@-
+@@ -32,24 +32,24 @@
  sparse: | version.h ipt_NETFLOW.c ipt_NETFLOW.h compat.h Makefile
@rm -f ipt_NETFLOW.ko ipt_NETFLOW.o
@echo Compiling for kernel $(KVERSION)
@@ -46,7 +47,7 @@
  
  sinstall: | snmp_NETFLOW.so IPT-NETFLOW-MIB.my
@echo " *"
-@@ -66,7 +66,7 @@ sinstall: | snmp_NETFLOW.so IPT-NETFLOW-MIB.my
+@@ -69,7 +69,7 @@
fi
  
  %_sh.o: libipt_NETFLOW.c

diff --git a/net-firewall/ipt_netflow/ipt_netflow-.ebuild 
b/net-firewall/ipt_netflow/ipt_netflow-2.6-r1.ebuild
similarity index 78%
copy from net-firewall/ipt_netflow/ipt_netflow-.ebuild
copy to net-firewall/ipt_netflow/ipt_netflow-2.6-r1.ebuild
index 986e6de1d7a8..ed681389901d 100644
--- a/net-firewall/ipt_netflow/ipt_netflow-.ebuild
+++ b/net-firewall/ipt_netflow/ipt_netflow-2.6-r1.ebuild
@@ -1,19 +1,21 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
-inherit git-r3 linux-info linux-mod toolchain-funcs
+inherit linux-mod-r1 toolchain-funcs
 
 DESCRIPTION="Netflow iptables module"
 HOMEPAGE="
https://sourceforge.net/projects/ipt-netflow
https://github.com/aabc/ipt-netflow
 "
-EGIT_REPO_URI="https://github.com/aabc/ipt-netflow;
+SRC_URI="https://github.com/aabc/ipt-netflow/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
 
 LICENSE="GPL-2"
 SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
 IUSE="debug natevents snmp"
 
 RDEPEND="
@@ -28,12 +30,13 @@ BDEPEND="
 
 PATCHES=(
"${FILESDIR}/${PN}-2.0-configure.patch" # bug #455984
-   "${FILESDIR}/${PN}--gentoo.patch"
+   "${FILESDIR}/${PN}-2.6-gentoo.patch"
+   "${FILESDIR}/${P}-ref_module_fix.patch" # bug #781014
+   "${FILESDIR}/${P}-fix-linux-headers-5.14.patch" # bug #813993
+
 )
 
 pkg_setup() {
-   linux-info_pkg_setup
-
local CONFIG_CHECK="BRIDGE_NETFILTER ~IP_NF_IPTABLES VLAN_8021Q"
use debug && CONFIG_CHECK+=" ~DEBUG_FS"
if use natevents; then
@@ -45,21 +48,19 @@ pkg_setup() {
fi
fi
 
-   BUILD_TARGETS="all"
-   MODULE_NAMES="ipt_NETFLOW(ipt_netflow)"
IPT_LIB="/usr/$(get_libdir)/xtables"
+   linux-mod-r1_pkg_setup
+}
 
-   linux-mod_pkg_setup
+src_unpack() {
+   default
+
+   mv "${WORKDIR}"/${PN/_/-}-* "${WORKDIR}"/${P} || die
 }
 
 src_prepare() {
default
 
-   # Fix incorrect module version in sources
-   sed -i \
-   -e '/IPT_NETFLOW_VERSION/s#"[0-9.]*"#"'${PV}'"#' \
-   ipt_NETFLOW.c || die
-
# Checking for directory is enough
sed -i \
-e 's:-s /etc/snmp/snmpd.conf:-d /etc/snmp:' \
@@ -93,11 +94,13 @@ src_configure() {
 }
 
 src_compile() {
+   local modlist=( ipt_NETFLOW=ipt_netflow )
+   linux-mod-r1_src_compile

[gentoo-commits] repo/gentoo:master commit in: net-firewall/ipt_netflow/, net-firewall/ipt_netflow/files/

2021-07-05 Thread Sergey Popov
commit: 646844f1f2373014a76b78442bb66f244aa23aa5
Author: Sergey Popov  gentoo  org>
AuthorDate: Mon Jul  5 14:12:59 2021 +
Commit: Sergey Popov  gentoo  org>
CommitDate: Mon Jul  5 14:15:04 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=646844f1

net-firewall/ipt_netflow-2.6: stable on amd64/x86

Drop old version

Bug: https://bugs.gentoo.org/791598
Package-Manager: Portage-3.0.18, Repoman-3.0.2
Signed-off-by: Sergey Popov  gentoo.org>

 net-firewall/ipt_netflow/Manifest  |   1 -
 .../ipt_netflow/files/ipt_netflow-2.5-gentoo.patch |  61 ---
 .../files/ipt_netflow-2.5.1-vlan_dev_priv.patch|  32 --
 .../ipt_netflow/ipt_netflow-2.5.1-r1.ebuild| 111 -
 net-firewall/ipt_netflow/ipt_netflow-2.6.ebuild|   2 +-
 5 files changed, 1 insertion(+), 206 deletions(-)

diff --git a/net-firewall/ipt_netflow/Manifest 
b/net-firewall/ipt_netflow/Manifest
index a779559db91..8d7eda97792 100644
--- a/net-firewall/ipt_netflow/Manifest
+++ b/net-firewall/ipt_netflow/Manifest
@@ -1,2 +1 @@
-DIST ipt_netflow-2.5.1.tar.gz 94627 BLAKE2B 
440daed1f0c02e4700c6d4a97da08abc7bf51c73cd824a67fd2b7b9394b47d493ca7acfea34467d93cdce6dded2c5b24b4a2600b9f717aa54561d1f88a123dbc
 SHA512 
dd0bde358f788f2d62ace6a0b1529128f0a686f9b776deeae3502d45d06d13971e8ea249d2647d00b00e73625c515bc12a4b7bd8d34fafd5f3b32f290d48cdce
 DIST ipt_netflow-2.6.tar.gz 95752 BLAKE2B 
088c7030addd34d9d889cfa705aa060d0793e33be957deb3b703daea4229afc24f7268285ce336e425a024dc9d8139633a5206ff9d769c95cf71c156acbd4f25
 SHA512 
0ccea556e25dc6bc2d8c7648ed1b4ab366097baf5b06f167ccd19d2adb0a195ad652635181573785f9e9fa208d163f22b6527310eb939455d7ee3bc141cbeed5

diff --git a/net-firewall/ipt_netflow/files/ipt_netflow-2.5-gentoo.patch 
b/net-firewall/ipt_netflow/files/ipt_netflow-2.5-gentoo.patch
deleted file mode 100644
index 508be107795..000
--- a/net-firewall/ipt_netflow/files/ipt_netflow-2.5-gentoo.patch
+++ /dev/null
@@ -1,61 +0,0 @@
 a/Makefile.in
-+++ b/Makefile.in
-@@ -11,7 +11,7 @@
- SNMPTGSO = /usr/lib/snmp/dlmod/snmp_NETFLOW.so
- SNMPCONF = /etc/snmp/snmpd.conf
- SNMPLINE = dlmod netflow $(SNMPTGSO)
--CC = gcc
-+CC ?= gcc
- 
- # https://www.kernel.org/doc/Documentation/kbuild/modules.txt
- # https://www.kernel.org/doc/Documentation/kbuild/makefiles.txt
-@@ -22,31 +22,31 @@
- 
- ipt_NETFLOW.ko: version.h ipt_NETFLOW.c ipt_NETFLOW.h compat_def.h compat.h 
Makefile
-   @echo Compiling for kernel $(KVERSION)
--  make -C $(KDIR) M=$(CURDIR) modules CONFIG_DEBUG_INFO=y
-+  $(MAKE) -C $(KDIR) M=$(CURDIR) modules CONFIG_DEBUG_INFO=y
-   @touch $@
- compat_def.h: gen_compat_def
-   ./gen_compat_def > $@
- sparse: | version.h ipt_NETFLOW.c ipt_NETFLOW.h compat.h Makefile
-   @rm -f ipt_NETFLOW.ko ipt_NETFLOW.o
-   @echo Compiling for kernel $(KVERSION)
--  make -C $(KDIR) M=$(CURDIR) modules C=1
-+  $(MAKE) -C $(KDIR) M=$(CURDIR) modules C=1
-   @touch ipt_NETFLOW.ko
- coverity:
-   coverity-submit -v
- 
- minstall: | ipt_NETFLOW.ko
-   @echo " *"
--  make -C $(KDIR) M=$(CURDIR) modules_install INSTALL_MOD_PATH=$(DESTDIR)
-+  $(MAKE) -C $(KDIR) M=$(CURDIR) modules_install 
INSTALL_MOD_PATH=$(DESTDIR)
-   $(DEPMOD)
- mclean:
--  make -C $(KDIR) M=$(CURDIR) clean
-+  $(MAKE) -C $(KDIR) M=$(CURDIR) clean
- lclean:
-   -rm -f *.so *_sh.o
- clean: mclean lclean
-   -rm -f *.so *.o modules.order version.h compat_def.h
- 
- snmp_NETFLOW.so: snmp_NETFLOW.c
--  $(CC) -fPIC -shared -o $@ $< -lnetsnmp
-+  $(CC) $(CFLAGS) $(LDFLAGS) -fPIC -shared -o $@ $< -lnetsnmp
- 
- sinstall: | snmp_NETFLOW.so IPT-NETFLOW-MIB.my
-   @echo " *"
-@@ -66,10 +66,10 @@
-   fi
- 
- %_sh.o: libipt_NETFLOW.c
--  $(CC) $(CFLAGS) -O2 -Wall -Wunused $(IPTABLES_CFLAGS) -fPIC -o $@ -c 
libipt_NETFLOW.c
-+  $(CC) $(CFLAGS) -Wall -Wunused $(IPTABLES_CFLAGS) -fPIC -o $@ -c 
libipt_NETFLOW.c
- 
- %.so: %_sh.o
--  $(CC) -shared -o $@ $<
-+  $(CC) $(LDFLAGS) -shared -o $@ $<
- 
- version.h: ipt_NETFLOW.c ipt_NETFLOW.h compat.h Makefile
-   @./version.sh --define > version.h

diff --git 
a/net-firewall/ipt_netflow/files/ipt_netflow-2.5.1-vlan_dev_priv.patch 
b/net-firewall/ipt_netflow/files/ipt_netflow-2.5.1-vlan_dev_priv.patch
deleted file mode 100644
index 49721e547fd..000
--- a/net-firewall/ipt_netflow/files/ipt_netflow-2.5.1-vlan_dev_priv.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-commit 1153f73f038205dc17303e6e6c45556191f7
-Author: ABC 
-Date:   Wed Oct 14 15:35:57 2020 +0300
-
-gen_compat_def: Check for vlan_dev_priv instead of version if
-
-diff --git a/gen_compat_def b/gen_compat_def
-index c0f20f6..3965e94 100755
 a/gen_compat_def
-+++ b/gen_compat_def
-@@ -85,6 +85,8 @@ kbuild_test_struct proc_ops linux/proc_fs.h
- kbuild_test_struct proc_ops linux/proc_fs.h
- # No since v5.1, but present in CentOS-8's 4.18.0-227
- kbuild_test_symbol synchronize_sched linux/rcupdate.h
-+# 

[gentoo-commits] repo/gentoo:master commit in: net-firewall/ipt_netflow/, net-firewall/ipt_netflow/files/

2021-05-27 Thread Sergey Popov
commit: 490a3ecbbc4e4e43a7e1b4d2253490f1ca169212
Author: Sergey Popov  gentoo  org>
AuthorDate: Thu May 27 10:01:51 2021 +
Commit: Sergey Popov  gentoo  org>
CommitDate: Thu May 27 10:01:51 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=490a3ecb

net-firewall/ipt_netflow: version bump

Package-Manager: Portage-3.0.18, Repoman-3.0.2
Signed-off-by: Sergey Popov  gentoo.org>

 net-firewall/ipt_netflow/Manifest  |   1 +
 .../ipt_netflow/files/ipt_netflow-2.6-gentoo.patch |  61 
 net-firewall/ipt_netflow/ipt_netflow-2.6.ebuild| 110 +
 3 files changed, 172 insertions(+)

diff --git a/net-firewall/ipt_netflow/Manifest 
b/net-firewall/ipt_netflow/Manifest
index 595c50a16e3..a779559db91 100644
--- a/net-firewall/ipt_netflow/Manifest
+++ b/net-firewall/ipt_netflow/Manifest
@@ -1 +1,2 @@
 DIST ipt_netflow-2.5.1.tar.gz 94627 BLAKE2B 
440daed1f0c02e4700c6d4a97da08abc7bf51c73cd824a67fd2b7b9394b47d493ca7acfea34467d93cdce6dded2c5b24b4a2600b9f717aa54561d1f88a123dbc
 SHA512 
dd0bde358f788f2d62ace6a0b1529128f0a686f9b776deeae3502d45d06d13971e8ea249d2647d00b00e73625c515bc12a4b7bd8d34fafd5f3b32f290d48cdce
+DIST ipt_netflow-2.6.tar.gz 95752 BLAKE2B 
088c7030addd34d9d889cfa705aa060d0793e33be957deb3b703daea4229afc24f7268285ce336e425a024dc9d8139633a5206ff9d769c95cf71c156acbd4f25
 SHA512 
0ccea556e25dc6bc2d8c7648ed1b4ab366097baf5b06f167ccd19d2adb0a195ad652635181573785f9e9fa208d163f22b6527310eb939455d7ee3bc141cbeed5

diff --git a/net-firewall/ipt_netflow/files/ipt_netflow-2.6-gentoo.patch 
b/net-firewall/ipt_netflow/files/ipt_netflow-2.6-gentoo.patch
new file mode 100644
index 000..44dcfdec6d7
--- /dev/null
+++ b/net-firewall/ipt_netflow/files/ipt_netflow-2.6-gentoo.patch
@@ -0,0 +1,61 @@
+--- a/Makefile.in  2021-05-27 12:57:29.600377496 +0300
 b/Makefile.in  2021-05-27 12:58:55.111381725 +0300
+@@ -13,7 +13,7 @@
+ SNMPTGSO = /usr/lib/snmp/dlmod/snmp_NETFLOW.so
+ SNMPCONF = /etc/snmp/snmpd.conf
+ SNMPLINE = dlmod netflow $(SNMPTGSO)
+-CC = gcc
++CC ?= gcc
+ 
+ # https://www.kernel.org/doc/Documentation/kbuild/modules.txt
+ # https://www.kernel.org/doc/Documentation/kbuild/makefiles.txt
+@@ -24,31 +24,31 @@
+ 
+ ipt_NETFLOW.ko: version.h ipt_NETFLOW.c ipt_NETFLOW.h compat_def.h compat.h 
Makefile
+   @echo Compiling $(shell ./version.sh) for kernel $(KVERSION)
+-  make -C $(KDIR) M=$(CURDIR) modules
++  $(MAKE) -C $(KDIR) M=$(CURDIR) modules
+   @touch $@
+ compat_def.h: gen_compat_def
+   ./gen_compat_def > $@
+ sparse: | version.h ipt_NETFLOW.c ipt_NETFLOW.h compat.h Makefile
+   @rm -f ipt_NETFLOW.ko ipt_NETFLOW.o
+   @echo Compiling for kernel $(KVERSION)
+-  make -C $(KDIR) M=$(CURDIR) modules C=1
++  $(MAKE) -C $(KDIR) M=$(CURDIR) modules C=1
+   @touch ipt_NETFLOW.ko
+ coverity:
+   coverity-submit -v
+ 
+ minstall: | ipt_NETFLOW.ko
+   @echo " *"
+-  make -C $(KDIR) M=$(CURDIR) modules_install INSTALL_MOD_PATH=$(DESTDIR)
++  $(MAKE) -C $(KDIR) M=$(CURDIR) modules_install 
INSTALL_MOD_PATH=$(DESTDIR)
+   $(DEPMOD)
+ mclean:
+-  make -C $(KDIR) M=$(CURDIR) clean
++  $(MAKE) -C $(KDIR) M=$(CURDIR) clean
+ lclean:
+   -rm -f *.so *_sh.o
+ clean: mclean lclean
+   -rm -f *.so *.o modules.order version.h compat_def.h
+ 
+ snmp_NETFLOW.so: snmp_NETFLOW.c
+-  $(CC) -fPIC -shared -o $@ $< -lnetsnmp
++  $(CC) $(CFLAGS) $(LDFLAGS) -fPIC -shared -o $@ $< -lnetsnmp
+ 
+ sinstall: | snmp_NETFLOW.so IPT-NETFLOW-MIB.my
+   @echo " *"
+@@ -68,10 +68,10 @@
+   fi
+ 
+ %_sh.o: libipt_NETFLOW.c
+-  $(CC) $(CFLAGS) -O2 -Wall -Wunused $(IPTABLES_CFLAGS) -fPIC -o $@ -c 
libipt_NETFLOW.c
++  $(CC) $(CFLAGS) -Wall -Wunused $(IPTABLES_CFLAGS) -fPIC -o $@ -c 
libipt_NETFLOW.c
+ 
+ %.so: %_sh.o
+-  $(CC) -shared -o $@ $<
++  $(CC) $(LDFLAGS) -shared -o $@ $<
+ 
+ version.h: ipt_NETFLOW.c ipt_NETFLOW.h compat.h Makefile
+   @./version.sh --define > version.h

diff --git a/net-firewall/ipt_netflow/ipt_netflow-2.6.ebuild 
b/net-firewall/ipt_netflow/ipt_netflow-2.6.ebuild
new file mode 100644
index 000..97fce443ce9
--- /dev/null
+++ b/net-firewall/ipt_netflow/ipt_netflow-2.6.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit linux-info linux-mod toolchain-funcs
+
+DESCRIPTION="Netflow iptables module"
+HOMEPAGE="
+   https://sourceforge.net/projects/ipt-netflow
+   https://github.com/aabc/ipt-netflow
+"
+SRC_URI="https://github.com/aabc/ipt-netflow/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="debug natevents snmp"
+
+RDEPEND="
+   net-firewall/iptables:0=
+   snmp? ( net-analyzer/net-snmp )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+   virtual/linux-sources
+   virtual/pkgconfig
+"
+
+PATCHES=(
+   "${FILESDIR}/${PN}-2.0-configure.patch" # bug 

[gentoo-commits] repo/gentoo:master commit in: net-firewall/ipt_netflow/, net-firewall/ipt_netflow/files/

2020-12-01 Thread Sergey Popov
commit: 36ff33603222f02db016a4a184e676f1e5b5c745
Author: Sergey Popov  gentoo  org>
AuthorDate: Wed Dec  2 07:17:57 2020 +
Commit: Sergey Popov  gentoo  org>
CommitDate: Wed Dec  2 07:19:44 2020 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=36ff3360

net-firewall/ipt_netflow: drop old version

Package-Manager: Portage-3.0.8, Repoman-3.0.2
Signed-off-by: Sergey Popov  gentoo.org>

 net-firewall/ipt_netflow/Manifest  |   1 -
 .../ipt_netflow/files/ipt_netflow-2.3-flags.patch  |  55 ---
 .../files/ipt_netflow-2.4-bridge_netfilter.patch   |  61 
 net-firewall/ipt_netflow/ipt_netflow-2.4-r1.ebuild | 105 -
 4 files changed, 222 deletions(-)

diff --git a/net-firewall/ipt_netflow/Manifest 
b/net-firewall/ipt_netflow/Manifest
index 592cc2926c3..595c50a16e3 100644
--- a/net-firewall/ipt_netflow/Manifest
+++ b/net-firewall/ipt_netflow/Manifest
@@ -1,2 +1 @@
-DIST ipt_netflow-2.4.tar.gz 92580 BLAKE2B 
0197e7e5cdd9c94c7b80b38cb4e2879343139592421922bf73aeaac70ac3af54ea25934bb1474ff455a9f58eab2368995591542f46be48b5c8491a3b6a192f56
 SHA512 
3c80d02cfda996fbde8d258875df8795000fd8390b5a6f8296771a992067e153eca48f7f4602421529948beaf3030e164adfc2ffe5b528042fbdc15ffb56aa74
 DIST ipt_netflow-2.5.1.tar.gz 94627 BLAKE2B 
440daed1f0c02e4700c6d4a97da08abc7bf51c73cd824a67fd2b7b9394b47d493ca7acfea34467d93cdce6dded2c5b24b4a2600b9f717aa54561d1f88a123dbc
 SHA512 
dd0bde358f788f2d62ace6a0b1529128f0a686f9b776deeae3502d45d06d13971e8ea249d2647d00b00e73625c515bc12a4b7bd8d34fafd5f3b32f290d48cdce

diff --git a/net-firewall/ipt_netflow/files/ipt_netflow-2.3-flags.patch 
b/net-firewall/ipt_netflow/files/ipt_netflow-2.3-flags.patch
deleted file mode 100644
index 0d89e5ba90a..000
--- a/net-firewall/ipt_netflow/files/ipt_netflow-2.3-flags.patch
+++ /dev/null
@@ -1,55 +0,0 @@
 a/Makefile.in
-+++ b/Makefile.in
-@@ -11,7 +11,7 @@
- SNMPTGSO = /usr/lib/snmp/dlmod/snmp_NETFLOW.so
- SNMPCONF = /etc/snmp/snmpd.conf
- SNMPLINE = dlmod netflow $(SNMPTGSO)
--CC = gcc
-+$(CC) ?= gcc
- 
- # https://www.kernel.org/doc/Documentation/kbuild/modules.txt
- # https://www.kernel.org/doc/Documentation/kbuild/makefiles.txt
-@@ -22,29 +22,29 @@
- 
- ipt_NETFLOW.ko: version.h ipt_NETFLOW.c ipt_NETFLOW.h compat.h Makefile
-   @echo Compiling for kernel $(KVERSION)
--  make -C $(KDIR) M=$(CURDIR) modules CONFIG_DEBUG_INFO=y
-+  $(MAKE) -C $(KDIR) M=$(CURDIR) modules CONFIG_DEBUG_INFO=y
-   @touch $@
- sparse: | version.h ipt_NETFLOW.c ipt_NETFLOW.h compat.h Makefile
-   @rm -f ipt_NETFLOW.ko ipt_NETFLOW.o
-   @echo Compiling for kernel $(KVERSION)
--  make -C $(KDIR) M=$(CURDIR) modules C=1
-+  $(MAKE) -C $(KDIR) M=$(CURDIR) modules C=1
-   @touch ipt_NETFLOW.ko
- coverity:
-   coverity-submit -v
- 
- minstall: | ipt_NETFLOW.ko
-   @echo " *"
--  make -C $(KDIR) M=$(CURDIR) modules_install INSTALL_MOD_PATH=$(DESTDIR)
-+  $(MAKE) -C $(KDIR) M=$(CURDIR) modules_install 
INSTALL_MOD_PATH=$(DESTDIR)
-   $(DEPMOD)
- mclean:
--  make -C $(KDIR) M=$(CURDIR) clean
-+  $(MAKE) -C $(KDIR) M=$(CURDIR) clean
- lclean:
-   -rm -f *.so *_sh.o
- clean: mclean lclean
-   -rm -f *.so *.o modules.order version.h
- 
- snmp_NETFLOW.so: snmp_NETFLOW.c
--  $(CC) -fPIC -shared -o $@ $< -lnetsnmp
-+  $(CC) $(CFLAGS) $(LDFLAGS) -fPIC -shared -o $@ $< -lnetsnmp
- 
- sinstall: | snmp_NETFLOW.so IPT-NETFLOW-MIB.my
-   @echo " *"
-@@ -64,7 +64,7 @@
-   fi
- 
- %_sh.o: libipt_NETFLOW.c
--  $(CC) $(CFLAGS) -O2 -Wall -Wunused $(IPTABLES_CFLAGS) -fPIC -o $@ -c 
libipt_NETFLOW.c
-+  $(CC) $(CFLAGS) $(LDFLAGS) -Wall -Wunused $(IPTABLES_CFLAGS) -fPIC -o 
$@ -c libipt_NETFLOW.c
- 
- %.so: %_sh.o
-   $(CC) -shared -o $@ $<

diff --git 
a/net-firewall/ipt_netflow/files/ipt_netflow-2.4-bridge_netfilter.patch 
b/net-firewall/ipt_netflow/files/ipt_netflow-2.4-bridge_netfilter.patch
deleted file mode 100644
index cde23bc9fe7..000
--- a/net-firewall/ipt_netflow/files/ipt_netflow-2.4-bridge_netfilter.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From 9288e30f493d252ee85b492a894f78073e4f6d41 Mon Sep 17 00:00:00 2001
-From: ABC 
-Date: Sat, 28 Sep 2019 23:29:40 +0300
-Subject: [PATCH] Don't compile physdev-override if BRIDGE_NETFILTER is
- disabled.
-
-Fixes #120 "Compile error nf_bridge / nf_trace" reported by DocMAX.
-
-Fixes: 51bdc2b ("Use nf_bridge_info_get() instead of skb->nf_bridge").

- compat.h  | 2 ++
- configure | 1 +
- ipt_NETFLOW.c | 5 +
- 3 files changed, 8 insertions(+)
-
-diff --git a/compat.h b/compat.h
-index 0f9896b..66e224b 100644
 a/compat.h
-+++ b/compat.h
-@@ -680,11 +680,13 @@ static inline int is_vlan_dev(struct net_device *dev)
- #endif
- 
- #if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0)
-+# ifdef CONFIG_BRIDGE_NETFILTER
- static inline struct nf_bridge_info *
- nf_bridge_info_get(const struct sk_buff *skb)
- {
-   return skb->nf_bridge;
- }
-+# endif
- #endif
- 

[gentoo-commits] repo/gentoo:master commit in: net-firewall/ipt_netflow/, net-firewall/ipt_netflow/files/

2020-11-15 Thread Sergey Popov
commit: 13a3eb076dd1b4ebd058333275c0363c7632f761
Author: Sergey Popov  gentoo  org>
AuthorDate: Sun Nov 15 15:26:44 2020 +
Commit: Sergey Popov  gentoo  org>
CommitDate: Sun Nov 15 15:26:44 2020 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=13a3eb07

net-firewall/ipt_netflow: backport some fixes for recent kernels

Reported-by: Agostino Sarubbo  gentoo.org>
Closes: https://bugs.gentoo.org/738062
Package-Manager: Portage-3.0.8, Repoman-3.0.2
Signed-off-by: Sergey Popov  gentoo.org>

 .../files/ipt_netflow-2.5.1-vlan_dev_priv.patch| 32 ++
 .../ipt_netflow/ipt_netflow-2.5.1-r1.ebuild|  1 +
 2 files changed, 33 insertions(+)

diff --git 
a/net-firewall/ipt_netflow/files/ipt_netflow-2.5.1-vlan_dev_priv.patch 
b/net-firewall/ipt_netflow/files/ipt_netflow-2.5.1-vlan_dev_priv.patch
new file mode 100644
index 000..49721e547fd
--- /dev/null
+++ b/net-firewall/ipt_netflow/files/ipt_netflow-2.5.1-vlan_dev_priv.patch
@@ -0,0 +1,32 @@
+commit 1153f73f038205dc17303e6e6c45556191f7
+Author: ABC 
+Date:   Wed Oct 14 15:35:57 2020 +0300
+
+gen_compat_def: Check for vlan_dev_priv instead of version if
+
+diff --git a/gen_compat_def b/gen_compat_def
+index c0f20f6..3965e94 100755
+--- a/gen_compat_def
 b/gen_compat_def
+@@ -85,6 +85,8 @@ kbuild_test_struct proc_ops linux/proc_fs.h
+ kbuild_test_struct proc_ops linux/proc_fs.h
+ # No since v5.1, but present in CentOS-8's 4.18.0-227
+ kbuild_test_symbol synchronize_sched linux/rcupdate.h
++# Stumbled on 5.9
++kbuild_test_struct vlan_dev_priv linux/if_vlan.h
+ 
+ echo "// End of compat_def.h"
+ 
+diff --git a/ipt_NETFLOW.c b/ipt_NETFLOW.c
+index 01055df..6f95166 100644
+--- a/ipt_NETFLOW.c
 b/ipt_NETFLOW.c
+@@ -4874,7 +4874,7 @@ static void parse_l2_header(const struct sk_buff *skb, 
struct ipt_netflow_tuple
+   tuple->tag[tag_num++] = htons(vlan_tx_tag_get(skb));
+   else if (skb->dev && is_vlan_dev(skb->dev)) {
+   struct net_device *vlan_dev = skb->dev;
+-# if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
++# ifdef HAVE_VLAN_DEV_PRIV
+   struct vlan_dev_priv *vlan = vlan_dev_priv(vlan_dev);
+ 
+   /* `if` condition is `#if`ed intentionally, and this is

diff --git a/net-firewall/ipt_netflow/ipt_netflow-2.5.1-r1.ebuild 
b/net-firewall/ipt_netflow/ipt_netflow-2.5.1-r1.ebuild
index 8fd0b2ad8ee..8fa83402ada 100644
--- a/net-firewall/ipt_netflow/ipt_netflow-2.5.1-r1.ebuild
+++ b/net-firewall/ipt_netflow/ipt_netflow-2.5.1-r1.ebuild
@@ -28,6 +28,7 @@ DEPEND="${RDEPEND}
 PATCHES=(
"${FILESDIR}/${PN}-2.0-configure.patch" # bug #455984
"${FILESDIR}/${PN}-2.5-gentoo.patch"
+   "${FILESDIR}/${P}-vlan_dev_priv.patch"
 )
 
 pkg_setup() {



[gentoo-commits] repo/gentoo:master commit in: net-firewall/ipt_netflow/, net-firewall/ipt_netflow/files/

2020-04-24 Thread Jeroen Roovers
commit: 357b104bd4dc416b7ef367785ed41d92d015e2fb
Author: Jeroen Roovers  gentoo  org>
AuthorDate: Fri Apr 24 07:34:25 2020 +
Commit: Jeroen Roovers  gentoo  org>
CommitDate: Fri Apr 24 07:35:07 2020 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=357b104b

net-firewall/ipt_netflow: Rename patch

Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Jeroen Roovers  gentoo.org>

 .../{ipt_netflow--flags.patch => ipt_netflow--gentoo.patch}   | 0
 net-firewall/ipt_netflow/ipt_netflow-.ebuild  | 4 ++--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net-firewall/ipt_netflow/files/ipt_netflow--flags.patch 
b/net-firewall/ipt_netflow/files/ipt_netflow--gentoo.patch
similarity index 100%
rename from net-firewall/ipt_netflow/files/ipt_netflow--flags.patch
rename to net-firewall/ipt_netflow/files/ipt_netflow--gentoo.patch

diff --git a/net-firewall/ipt_netflow/ipt_netflow-.ebuild 
b/net-firewall/ipt_netflow/ipt_netflow-.ebuild
index 06411e1ae6d..b0382acd22d 100644
--- a/net-firewall/ipt_netflow/ipt_netflow-.ebuild
+++ b/net-firewall/ipt_netflow/ipt_netflow-.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -27,7 +27,7 @@ DEPEND="${RDEPEND}
 "
 PATCHES=(
"${FILESDIR}/${PN}-2.0-configure.patch" # bug #455984
-   "${FILESDIR}/${PN}--flags.patch"
+   "${FILESDIR}/${PN}--gentoo.patch"
 )
 
 pkg_setup() {



[gentoo-commits] repo/gentoo:master commit in: net-firewall/ipt_netflow/, net-firewall/ipt_netflow/files/

2020-01-28 Thread Sergey Popov
commit: a0bd2ac5ca14b0b670df2b0934fea96b1b89a1fc
Author: Sergey Popov  gentoo  org>
AuthorDate: Tue Jan 28 09:21:28 2020 +
Commit: Sergey Popov  gentoo  org>
CommitDate: Tue Jan 28 09:22:48 2020 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a0bd2ac5

net-firewall/ipt_netflow-2.4: build-time fixes

Fix building with kernel where CONFIG_BRIDGE_NETFILTER is not set

Signed-off-by: Sergey Popov  gentoo.org>
Package-Manager: Portage-2.3.84, Repoman-2.3.11

 .../files/ipt_netflow-2.4-bridge_netfilter.patch   | 61 ++
 net-firewall/ipt_netflow/ipt_netflow-2.4.ebuild|  3 +-
 2 files changed, 63 insertions(+), 1 deletion(-)

diff --git 
a/net-firewall/ipt_netflow/files/ipt_netflow-2.4-bridge_netfilter.patch 
b/net-firewall/ipt_netflow/files/ipt_netflow-2.4-bridge_netfilter.patch
new file mode 100644
index 000..cde23bc9fe7
--- /dev/null
+++ b/net-firewall/ipt_netflow/files/ipt_netflow-2.4-bridge_netfilter.patch
@@ -0,0 +1,61 @@
+From 9288e30f493d252ee85b492a894f78073e4f6d41 Mon Sep 17 00:00:00 2001
+From: ABC 
+Date: Sat, 28 Sep 2019 23:29:40 +0300
+Subject: [PATCH] Don't compile physdev-override if BRIDGE_NETFILTER is
+ disabled.
+
+Fixes #120 "Compile error nf_bridge / nf_trace" reported by DocMAX.
+
+Fixes: 51bdc2b ("Use nf_bridge_info_get() instead of skb->nf_bridge").
+---
+ compat.h  | 2 ++
+ configure | 1 +
+ ipt_NETFLOW.c | 5 +
+ 3 files changed, 8 insertions(+)
+
+diff --git a/compat.h b/compat.h
+index 0f9896b..66e224b 100644
+--- a/compat.h
 b/compat.h
+@@ -680,11 +680,13 @@ static inline int is_vlan_dev(struct net_device *dev)
+ #endif
+ 
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0)
++# ifdef CONFIG_BRIDGE_NETFILTER
+ static inline struct nf_bridge_info *
+ nf_bridge_info_get(const struct sk_buff *skb)
+ {
+   return skb->nf_bridge;
+ }
++# endif
+ #endif
+ 
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)
+diff --git a/configure b/configure
+index 74eece5..8aae8bf 100755
+--- a/configure
 b/configure
+@@ -470,6 +470,7 @@ kernel_check_config() {
+   kconfig CONFIG_NF_CONNTRACK_EVENTS  "natevents"
+   kconfig CONFIG_IPV6 "IPv6"
+   kconfig CONFIG_IP6_NF_IPTABLES  "ip6tables target"
++  kconfig CONFIG_BRIDGE_NETFILTER "physdev override"
+ }
+ 
+ kernel_check_include() {
+diff --git a/ipt_NETFLOW.c b/ipt_NETFLOW.c
+index fe25655..064de6c 100644
+--- a/ipt_NETFLOW.c
 b/ipt_NETFLOW.c
+@@ -83,6 +83,11 @@
+ #if defined(CONFIG_NF_NAT_NEEDED) && LINUX_VERSION_CODE >= 
KERNEL_VERSION(2,6,39)
+ # include 
+ #endif
++#ifdef ENABLE_PHYSDEV_OVER
++# ifndef CONFIG_BRIDGE_NETFILTER
++#  undef ENABLE_PHYSDEV_OVER
++# endif
++#endif
+ 
+ #define IPT_NETFLOW_VERSION "2.4"   /* Note that if you are using git, you
+  will see version in other format. */

diff --git a/net-firewall/ipt_netflow/ipt_netflow-2.4.ebuild 
b/net-firewall/ipt_netflow/ipt_netflow-2.4.ebuild
index 8db277d79e5..c3bec366b46 100644
--- a/net-firewall/ipt_netflow/ipt_netflow-2.4.ebuild
+++ b/net-firewall/ipt_netflow/ipt_netflow-2.4.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -28,6 +28,7 @@ DEPEND="${RDEPEND}
 PATCHES=(
"${FILESDIR}/${PN}-2.0-configure.patch" # bug #455984
"${FILESDIR}/${PN}-2.3-flags.patch"
+   "${FILESDIR}/${P}-bridge_netfilter.patch"
 )
 
 pkg_setup() {



[gentoo-commits] repo/gentoo:master commit in: net-firewall/ipt_netflow/, net-firewall/ipt_netflow/files/

2019-12-27 Thread Jeroen Roovers
commit: d689f34b6a0bd248867c5e0f43df76f4326daaf3
Author: Jeroen Roovers  gentoo  org>
AuthorDate: Fri Dec 27 19:17:42 2019 +
Commit: Jeroen Roovers  gentoo  org>
CommitDate: Fri Dec 27 19:20:03 2019 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d689f34b

net-firewall/ipt_netflow: Update live ebuild

Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Jeroen Roovers  gentoo.org>

 .../ipt_netflow/files/ipt_netflow--flags.patch | 57 ++
 net-firewall/ipt_netflow/ipt_netflow-.ebuild   | 10 ++--
 2 files changed, 64 insertions(+), 3 deletions(-)

diff --git a/net-firewall/ipt_netflow/files/ipt_netflow--flags.patch 
b/net-firewall/ipt_netflow/files/ipt_netflow--flags.patch
new file mode 100644
index 000..675e8b16f72
--- /dev/null
+++ b/net-firewall/ipt_netflow/files/ipt_netflow--flags.patch
@@ -0,0 +1,57 @@
+--- a/Makefile.in
 b/Makefile.in
+@@ -11,7 +11,7 @@ CARGS = @CARGS@
+ SNMPTGSO = /usr/lib/snmp/dlmod/snmp_NETFLOW.so
+ SNMPCONF = /etc/snmp/snmpd.conf
+ SNMPLINE = dlmod netflow $(SNMPTGSO)
+-CC = gcc
++$(CC) ?= gcc
+ 
+ # https://www.kernel.org/doc/Documentation/kbuild/modules.txt
+ # https://www.kernel.org/doc/Documentation/kbuild/makefiles.txt
+@@ -22,31 +22,31 @@ all: ipt_NETFLOW.ko libipt_NETFLOW.so libip6t_NETFLOW.so 
@SNMPTARGET@
+ 
+ ipt_NETFLOW.ko: version.h ipt_NETFLOW.c ipt_NETFLOW.h compat_def.h compat.h 
Makefile
+   @echo Compiling for kernel $(KVERSION)
+-  make -C $(KDIR) M=$(CURDIR) modules CONFIG_DEBUG_INFO=y
++  $(MAKE) -C $(KDIR) M=$(CURDIR) modules CONFIG_DEBUG_INFO=y
+   @touch $@
+ compat_def.h: gen_compat_def
+   ./gen_compat_def > $@
+ sparse: | version.h ipt_NETFLOW.c ipt_NETFLOW.h compat.h Makefile
+   @rm -f ipt_NETFLOW.ko ipt_NETFLOW.o
+   @echo Compiling for kernel $(KVERSION)
+-  make -C $(KDIR) M=$(CURDIR) modules C=1
++  $(MAKE) -C $(KDIR) M=$(CURDIR) modules C=1
+   @touch ipt_NETFLOW.ko
+ coverity:
+   coverity-submit -v
+ 
+ minstall: | ipt_NETFLOW.ko
+   @echo " *"
+-  make -C $(KDIR) M=$(CURDIR) modules_install INSTALL_MOD_PATH=$(DESTDIR)
++  $(MAKE) -C $(KDIR) M=$(CURDIR) modules_install 
INSTALL_MOD_PATH=$(DESTDIR)
+   $(DEPMOD)
+ mclean:
+-  make -C $(KDIR) M=$(CURDIR) clean
++  $(MAKE) -C $(KDIR) M=$(CURDIR) clean
+ lclean:
+   -rm -f *.so *_sh.o
+ clean: mclean lclean
+   -rm -f *.so *.o modules.order version.h compat_def.h
+ 
+ snmp_NETFLOW.so: snmp_NETFLOW.c
+-  $(CC) -fPIC -shared -o $@ $< -lnetsnmp
++  $(CC) $(CFLAGS) $(LDFLAGS) -fPIC -shared -o $@ $< -lnetsnmp
+ 
+ sinstall: | snmp_NETFLOW.so IPT-NETFLOW-MIB.my
+   @echo " *"
+@@ -66,7 +66,7 @@ sinstall: | snmp_NETFLOW.so IPT-NETFLOW-MIB.my
+   fi
+ 
+ %_sh.o: libipt_NETFLOW.c
+-  $(CC) $(CFLAGS) -O2 -Wall -Wunused $(IPTABLES_CFLAGS) -fPIC -o $@ -c 
libipt_NETFLOW.c
++  $(CC) $(CFLAGS) $(LDFLAGS) -Wall -Wunused $(IPTABLES_CFLAGS) -fPIC -o 
$@ -c libipt_NETFLOW.c
+ 
+ %.so: %_sh.o
+   $(CC) -shared -o $@ $<

diff --git a/net-firewall/ipt_netflow/ipt_netflow-.ebuild 
b/net-firewall/ipt_netflow/ipt_netflow-.ebuild
index 7414800f8c3..06411e1ae6d 100644
--- a/net-firewall/ipt_netflow/ipt_netflow-.ebuild
+++ b/net-firewall/ipt_netflow/ipt_netflow-.ebuild
@@ -27,7 +27,7 @@ DEPEND="${RDEPEND}
 "
 PATCHES=(
"${FILESDIR}/${PN}-2.0-configure.patch" # bug #455984
-   "${FILESDIR}/${PN}-2.3-flags.patch"
+   "${FILESDIR}/${PN}--flags.patch"
 )
 
 pkg_setup() {
@@ -55,10 +55,14 @@ src_prepare() {
default
 
# Fix incorrect module version in sources
-   sed -i -e "/IPT_NETFLOW_VERSION/s/2.2/${PV}/" ipt_NETFLOW.c || die
+   sed -i \
+   -e '/IPT_NETFLOW_VERSION/s#"[0-9.]*"#"'${PV}'"#' \
+   ipt_NETFLOW.c || die
 
# Checking for directory is enough
-   sed -i -e 's:-s /etc/snmp/snmpd.conf:-d /etc/snmp:' configure || die
+   sed -i \
+   -e 's:-s /etc/snmp/snmpd.conf:-d /etc/snmp:' \
+   configure || die
 }
 
 do_conf() {



[gentoo-commits] repo/gentoo:master commit in: net-firewall/ipt_netflow/, net-firewall/ipt_netflow/files/

2018-06-15 Thread Sergey Popov
commit: c660433b8bc48e33d10235252f8e28f3ca835db2
Author: Sergey Popov  gentoo  org>
AuthorDate: Fri Jun 15 15:59:17 2018 +
Commit: Sergey Popov  gentoo  org>
CommitDate: Fri Jun 15 16:01:21 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c660433b

net-firewall/ipt_netflow: drop old

Package-Manager: Portage-2.3.31, Repoman-2.3.9

 net-firewall/ipt_netflow/Manifest  |   1 -
 .../files/ipt_netflow-2.2-linux-4.10.patch | 137 -
 .../files/ipt_netflow-2.2-linux-4.13.patch |  63 --
 .../files/ipt_netflow-2.2-linux-4.15.patch |  26 
 .../files/ipt_netflow-2.2-linux-4.6.patch  |  61 -
 net-firewall/ipt_netflow/ipt_netflow-2.2-r2.ebuild | 105 
 net-firewall/ipt_netflow/ipt_netflow-2.2-r3.ebuild | 105 
 7 files changed, 498 deletions(-)

diff --git a/net-firewall/ipt_netflow/Manifest 
b/net-firewall/ipt_netflow/Manifest
index b87114ce096..804ced3b34f 100644
--- a/net-firewall/ipt_netflow/Manifest
+++ b/net-firewall/ipt_netflow/Manifest
@@ -1,2 +1 @@
-DIST ipt-netflow-2.2.tgz 96697 BLAKE2B 
996ad539b6a6a5198a1e4a4a1a51f0610d97fb45740ad9c92e19854f2928eb697ca8fe14625054a05b106eebc345dfe6c235cdf375d1360ef44ff6cf0b03f34a
 SHA512 
a406ab9bd18616414d8c99f427382a075bdb8000d8c40959f5b6d6e577d7eb4dfc7f8b773664a516ec2228d15590f21c3fbd6aa3d4302f6cdf03810e1702af74
 DIST ipt_netflow-2.3.tar.gz 90987 BLAKE2B 
fbe46583e58e75e3cfe5cc5ad4e8b40d5040d6642f850c560c3e8aa831effa43cba8f25907d32b3b66721f4d5d5bb8579bafa82e4b8d1c9a2225a5c748d08dd9
 SHA512 
e5ba66da9cae6fb9652e5532383233d433dd30dd16634734860f7e6910e46080e562e2d72c74584a86ead31156cffd4c5c44b438f617a9e5b3e5fdc1470045fc

diff --git a/net-firewall/ipt_netflow/files/ipt_netflow-2.2-linux-4.10.patch 
b/net-firewall/ipt_netflow/files/ipt_netflow-2.2-linux-4.10.patch
deleted file mode 100644
index 7e8f62840a9..000
--- a/net-firewall/ipt_netflow/files/ipt_netflow-2.2-linux-4.10.patch
+++ /dev/null
@@ -1,137 +0,0 @@
-commit 5d71c94c400d91633f6d3c3be9e785bb23d4ca1a
-Author: ABC 
-Date:   Sun Mar 5 11:27:39 2017 +0300
-
-Compilation compatibility with kernel 4.10.
-
-Fixes #70.
-Resolves incompatibilities introduced by
- 2456e855354415bfaeb7badaa14e11b3e02c8466 and
- 613dbd95723aee7abd16860745691b6c7bda20dc for kernel 4.10.
-
-diff --git a/compat.h b/compat.h
-index 3f27977..47176ef 100644
 a/compat.h
-+++ b/compat.h
-@@ -600,4 +600,29 @@ out:
- # define __GNUC_PREREQ(maj, min) 0
- #endif
- 
-+/* ktime is not union anymore, since 2456e855354415bfaeb7badaa14e11b3e02c8466 
*/
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
-+# define first_tv64   first.tv64
-+# define last_tv64last.tv64
-+#else
-+# define first_tv64   first
-+# define last_tv64last
-+#endif
-+
-+/* Offset changes made in 613dbd95723aee7abd16860745691b6c7bda20dc */
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28) && LINUX_VERSION_CODE < 
KERNEL_VERSION(4,10,0)
-+static inline u_int8_t xt_family(const struct xt_action_param *par)
-+{
-+  return par->family;
-+}
-+static inline const struct net_device *xt_in(const struct xt_action_param 
*par)
-+{
-+  return par->in;
-+}
-+static inline const struct net_device *xt_out(const struct xt_action_param 
*par)
-+{
-+  return par->out;
-+}
-+#endif
-+
- #endif /* COMPAT_NETFLOW_H */
-diff --git a/ipt_NETFLOW.c b/ipt_NETFLOW.c
-index 781b284..0d1ac55 100644
 a/ipt_NETFLOW.c
-+++ b/ipt_NETFLOW.c
-@@ -3863,10 +3863,10 @@ static void netflow_export_stats(void)
-   t.pkts_selected += st->pkts_selected;
-   t.pkts_observed += st->pkts_observed;
- #endif
--  t.drop.first.tv64 = min_not_zero(t.drop.first.tv64, 
st->drop.first.tv64);
--  t.drop.last.tv64  = max(t.drop.last.tv64, st->drop.last.tv64);
--  t.lost.first.tv64 = min_not_zero(t.lost.first.tv64, 
st->lost.first.tv64);
--  t.lost.last.tv64  = max(t.lost.last.tv64, st->lost.last.tv64);
-+  t.drop.first_tv64 = min_not_zero(t.drop.first_tv64, 
st->drop.first_tv64);
-+  t.drop.last_tv64  = max(t.drop.last_tv64, st->drop.last_tv64);
-+  t.lost.first_tv64 = min_not_zero(t.lost.first_tv64, 
st->lost.first_tv64);
-+  t.lost.last_tv64  = max(t.lost.last_tv64, st->lost.last_tv64);
-   }
- 
-   export_stat_st(OTPL_MPSTAT, );
-@@ -4781,8 +4781,8 @@ static unsigned int netflow_target(
-  const void *targinfo
- # endif
- #else /* since 2.6.28 */
--# define if_in  par->in
--# define if_out par->out
-+# define if_in  xt_in(par)
-+# define if_out xt_out(par)
- # if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
-  const struct xt_target_param *par
- # else
-@@ -4809,7 +4809,7 @@ static unsigned int netflow_target(
- #ifdef ENABLE_DIRECTION
-   const int hooknum = par->hooknum;
- #endif
--  const int family = par->family;
-+  const int family = 

[gentoo-commits] repo/gentoo:master commit in: net-firewall/ipt_netflow/, net-firewall/ipt_netflow/files/

2018-02-10 Thread Jeroen Roovers
commit: e67466e42c6fc3c2775258cad58e1803b352e3bf
Author: Jeroen Roovers  gentoo  org>
AuthorDate: Sat Feb 10 11:21:57 2018 +
Commit: Jeroen Roovers  gentoo  org>
CommitDate: Sat Feb 10 11:22:08 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e67466e4

net-firewall/ipt_netflow: Fix kernel 4.15 compatibility (bug #646798).

Package-Manager: Portage-2.3.24, Repoman-2.3.6

 .../files/ipt_netflow-2.2-linux-4.15.patch |  26 ++
 net-firewall/ipt_netflow/ipt_netflow-2.2-r3.ebuild | 102 +
 2 files changed, 128 insertions(+)

diff --git a/net-firewall/ipt_netflow/files/ipt_netflow-2.2-linux-4.15.patch 
b/net-firewall/ipt_netflow/files/ipt_netflow-2.2-linux-4.15.patch
new file mode 100644
index 000..aa5feef3279
--- /dev/null
+++ b/net-firewall/ipt_netflow/files/ipt_netflow-2.2-linux-4.15.patch
@@ -0,0 +1,26 @@
+--- a/ipt_NETFLOW.c
 b/ipt_NETFLOW.c
+@@ -4357,7 +4357,11 @@
+ #define CALC_RATE(ewma, cur, minutes) ewma += _A(cur - ewma, minutes)
+ 
+ // calculate EWMA throughput rate for whole module
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
++static void rate_timer_calc(struct timer_list *t)
++#else
+ static void rate_timer_calc(unsigned long dummy)
++#endif
+ {
+   static u64 old_pkt_total = 0;
+   static u64 old_traf_total = 0;
+@@ -5525,7 +5525,11 @@
+ 
+   netflow_switch_version(protocol);
+   _schedule_scan_worker(0);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
++  timer_setup(_timer, rate_timer_calc, 0);
++#else
+   setup_timer(_timer, rate_timer_calc, 0);
++#endif
+   mod_timer(_timer, jiffies + (HZ * SAMPLERATE));
+ 
+   peakflows_at = jiffies;

diff --git a/net-firewall/ipt_netflow/ipt_netflow-2.2-r3.ebuild 
b/net-firewall/ipt_netflow/ipt_netflow-2.2-r3.ebuild
new file mode 100644
index 000..b2bda0e5889
--- /dev/null
+++ b/net-firewall/ipt_netflow/ipt_netflow-2.2-r3.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+MY_PN="${PN/_/-}"
+MY_P="${MY_PN}-${PV}"
+inherit linux-info linux-mod toolchain-funcs
+
+DESCRIPTION="Netflow iptables module"
+HOMEPAGE="https://sourceforge.net/projects/ipt-netflow;
+SRC_URI="mirror://sourceforge/${MY_PN}/${MY_P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="debug natevents snmp"
+
+RDEPEND="
+   net-firewall/iptables
+   snmp? ( net-analyzer/net-snmp )
+"
+DEPEND="${RDEPEND}
+   virtual/linux-sources
+   virtual/pkgconfig
+"
+
+# set S before MODULE_NAMES
+S="${WORKDIR}/${MY_P}"
+PATCHES=(
+   # bug #455984
+   "${FILESDIR}/${PN}-2.0-configure.patch"
+   # Compatibility with kernel 4.6
+   "${FILESDIR}/${P}-linux-4.6.patch"
+   # Compatibility with kernel 4.10, bug #617484
+   "${FILESDIR}/${P}-linux-4.10.patch"
+   # Compatibility with kernel 4.13, bug #630446
+   "${FILESDIR}/${P}-linux-4.13.patch"
+   # Compatibility with kernel 4.15, bug #646798
+   "${FILESDIR}/${P}-linux-4.15.patch"
+)
+
+pkg_setup() {
+   BUILD_TARGETS="all"
+   MODULE_NAMES="ipt_NETFLOW(ipt_netflow:${S})"
+   IPT_LIB="/usr/$(get_libdir)/xtables"
+   local CONFIG_CHECK="~IP_NF_IPTABLES"
+   use debug && CONFIG_CHECK+=" ~DEBUG_FS"
+   use natevents && CONFIG_CHECK+=" NF_CONNTRACK_EVENTS NF_NAT_NEEDED"
+   linux-mod_pkg_setup
+}
+
+src_prepare() {
+   sed -i \
+   -e 's:make -C:$(MAKE) -C:g' \
+   -e 's:gcc -O2:$(CC) $(CFLAGS) $(LDFLAGS):' \
+   -e 's:gcc:$(CC) $(CFLAGS) $(LDFLAGS):' \
+   Makefile.in || die
+
+   # Checking for directory is enough
+   sed -i -e 's:-s /etc/snmp/snmpd.conf:-d /etc/snmp:' configure || die
+
+   default
+}
+
+do_conf() {
+   echo ./configure $*
+   ./configure $* ${EXTRA_ECONF} || die 'configure failed'
+}
+
+src_configure() {
+   local IPT_VERSION="$($(tc-getPKG_CONFIG) --modversion xtables)"
+   # this configure script is not based on autotools
+   # ipt-src need to be defined, see bug #455984
+   do_conf \
+   --disable-dkms \
+   --enable-aggregation \
+   --enable-direction \
+   --enable-macaddress \
+   --enable-vlan \
+   --ipt-lib="${IPT_LIB}" \
+   --ipt-src="/usr/" \
+   --ipt-ver="${IPT_VERSION}" \
+   --kdir="${KV_DIR}" \
+   --kver="${KV_FULL}" \
+   $(use debug && echo '--enable-debugfs') \
+   $(use natevents && echo '--enable-natevents') \
+   $(use snmp && echo '--enable-snmp-rules' || echo 
'--disable-snmp-agent')
+}
+
+src_compile() {
+   emake ARCH="$(tc-arch-kernel)" CC="$(tc-getCC)" all
+}
+
+src_install() {
+   linux-mod_src_install
+   exeinto "${IPT_LIB}"
+   doexe libipt_NETFLOW.so
+   use snmp && emake DESTDIR="${D}" 

[gentoo-commits] repo/gentoo:master commit in: net-firewall/ipt_netflow/, net-firewall/ipt_netflow/files/

2017-05-16 Thread Sergey Popov
commit: 2839798db8f159e92e64a37d83b9899e1570926c
Author: Sergey Popov  gentoo  org>
AuthorDate: Tue May 16 16:18:31 2017 +
Commit: Sergey Popov  gentoo  org>
CommitDate: Tue May 16 16:18:31 2017 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2839798d

net-firewall/ipt_netflow: backport upstream fix for building with kernel 4.10

Reported-by: Toralf Förster  gmx.de>
Gentoo-Bug: 617484

Package-Manager: Portage-2.3.5, Repoman-2.3.1

 .../files/ipt_netflow-2.2-linux-4.10.patch | 137 +
 net-firewall/ipt_netflow/ipt_netflow-2.2-r1.ebuild |   5 +-
 2 files changed, 141 insertions(+), 1 deletion(-)

diff --git a/net-firewall/ipt_netflow/files/ipt_netflow-2.2-linux-4.10.patch 
b/net-firewall/ipt_netflow/files/ipt_netflow-2.2-linux-4.10.patch
new file mode 100644
index 000..7e8f62840a9
--- /dev/null
+++ b/net-firewall/ipt_netflow/files/ipt_netflow-2.2-linux-4.10.patch
@@ -0,0 +1,137 @@
+commit 5d71c94c400d91633f6d3c3be9e785bb23d4ca1a
+Author: ABC 
+Date:   Sun Mar 5 11:27:39 2017 +0300
+
+Compilation compatibility with kernel 4.10.
+
+Fixes #70.
+Resolves incompatibilities introduced by
+ 2456e855354415bfaeb7badaa14e11b3e02c8466 and
+ 613dbd95723aee7abd16860745691b6c7bda20dc for kernel 4.10.
+
+diff --git a/compat.h b/compat.h
+index 3f27977..47176ef 100644
+--- a/compat.h
 b/compat.h
+@@ -600,4 +600,29 @@ out:
+ # define __GNUC_PREREQ(maj, min) 0
+ #endif
+ 
++/* ktime is not union anymore, since 2456e855354415bfaeb7badaa14e11b3e02c8466 
*/
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
++# define first_tv64   first.tv64
++# define last_tv64last.tv64
++#else
++# define first_tv64   first
++# define last_tv64last
++#endif
++
++/* Offset changes made in 613dbd95723aee7abd16860745691b6c7bda20dc */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28) && LINUX_VERSION_CODE < 
KERNEL_VERSION(4,10,0)
++static inline u_int8_t xt_family(const struct xt_action_param *par)
++{
++  return par->family;
++}
++static inline const struct net_device *xt_in(const struct xt_action_param 
*par)
++{
++  return par->in;
++}
++static inline const struct net_device *xt_out(const struct xt_action_param 
*par)
++{
++  return par->out;
++}
++#endif
++
+ #endif /* COMPAT_NETFLOW_H */
+diff --git a/ipt_NETFLOW.c b/ipt_NETFLOW.c
+index 781b284..0d1ac55 100644
+--- a/ipt_NETFLOW.c
 b/ipt_NETFLOW.c
+@@ -3863,10 +3863,10 @@ static void netflow_export_stats(void)
+   t.pkts_selected += st->pkts_selected;
+   t.pkts_observed += st->pkts_observed;
+ #endif
+-  t.drop.first.tv64 = min_not_zero(t.drop.first.tv64, 
st->drop.first.tv64);
+-  t.drop.last.tv64  = max(t.drop.last.tv64, st->drop.last.tv64);
+-  t.lost.first.tv64 = min_not_zero(t.lost.first.tv64, 
st->lost.first.tv64);
+-  t.lost.last.tv64  = max(t.lost.last.tv64, st->lost.last.tv64);
++  t.drop.first_tv64 = min_not_zero(t.drop.first_tv64, 
st->drop.first_tv64);
++  t.drop.last_tv64  = max(t.drop.last_tv64, st->drop.last_tv64);
++  t.lost.first_tv64 = min_not_zero(t.lost.first_tv64, 
st->lost.first_tv64);
++  t.lost.last_tv64  = max(t.lost.last_tv64, st->lost.last_tv64);
+   }
+ 
+   export_stat_st(OTPL_MPSTAT, );
+@@ -4781,8 +4781,8 @@ static unsigned int netflow_target(
+  const void *targinfo
+ # endif
+ #else /* since 2.6.28 */
+-# define if_in  par->in
+-# define if_out par->out
++# define if_in  xt_in(par)
++# define if_out xt_out(par)
+ # if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
+  const struct xt_target_param *par
+ # else
+@@ -4809,7 +4809,7 @@ static unsigned int netflow_target(
+ #ifdef ENABLE_DIRECTION
+   const int hooknum = par->hooknum;
+ #endif
+-  const int family = par->family;
++  const int family = xt_family(par);
+ #endif
+   struct ipt_netflow_tuple tuple;
+   struct ipt_netflow *nf;
+diff --git a/ipt_NETFLOW.h b/ipt_NETFLOW.h
+index eb00e94..3ee44a8 100644
+--- a/ipt_NETFLOW.h
 b/ipt_NETFLOW.h
+@@ -414,7 +414,7 @@ struct netflow_aggr_p {
+ #define NETFLOW_STAT_TS(count)
 \
+   do {
 \
+   ktime_t kts = ktime_get_real(); 
 \
+-  if (!(__get_cpu_var(ipt_netflow_stat)).count.first.tv64)
 \
++  if (!(__get_cpu_var(ipt_netflow_stat)).count.first_tv64)
 \
+   __get_cpu_var(ipt_netflow_stat).count.first = kts;  
 \
+   __get_cpu_var(ipt_netflow_stat).count.last = kts;   
 \
+   } while (0);
+commit 5dec6355f151a5c9fa4393c43388b22d9c720fae
+Author: ABC 
+Date:   Tue Mar 14 21:55:29 2017 +0300
+
+More compatibility with kernel 4.10.
+
+Thanks 

[gentoo-commits] repo/gentoo:master commit in: net-firewall/ipt_netflow/, net-firewall/ipt_netflow/files/

2016-07-19 Thread Sergey Popov
commit: 2ad5de1938d063ff68d5ea9c254cf2158bdf0c71
Author: Sergey Popov  gentoo  org>
AuthorDate: Tue Jul 19 09:13:50 2016 +
Commit: Sergey Popov  gentoo  org>
CommitDate: Tue Jul 19 09:13:50 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2ad5de19

net-firewall/ipt_netflow: revision bump

Backport compatibility patch for Linux kernel 4.6

Package-Manager: portage-2.2.28

 .../files/ipt_netflow-2.2-linux-4.6.patch  | 61 +++
 net-firewall/ipt_netflow/ipt_netflow-2.2-r1.ebuild | 91 ++
 2 files changed, 152 insertions(+)

diff --git a/net-firewall/ipt_netflow/files/ipt_netflow-2.2-linux-4.6.patch 
b/net-firewall/ipt_netflow/files/ipt_netflow-2.2-linux-4.6.patch
new file mode 100644
index 000..bd9bedd
--- /dev/null
+++ b/net-firewall/ipt_netflow/files/ipt_netflow-2.2-linux-4.6.patch
@@ -0,0 +1,61 @@
+commit c16ffc6cb679b3377a0d4a30a6bbcf5e2f3d0214
+Author: ABC 
+Date:   Sun May 22 22:07:14 2016 +0300
+
+Support ETHTOOL_xLINKSETTINGS API (new in linux 4.6).
+
+Thus, making support for 4.6 kernels.
+Reference to linux commit:
+  https://github.com/torvalds/linux/commit/3f1ac7a700d
+
+Fixes #56, thanks karel-un.
+
+diff --git a/ipt_NETFLOW.c b/ipt_NETFLOW.c
+index 067fd50..d27eea2 100644
+--- a/ipt_NETFLOW.c
 b/ipt_NETFLOW.c
+@@ -3904,7 +3904,13 @@ static int ethtool_drvinfo(unsigned char *ptr, size_t 
size, struct net_device *d
+ {
+   struct ethtool_drvinfo info = { 0 };
+   const struct ethtool_ops *ops = dev->ethtool_ops;
++#ifndef ETHTOOL_GLINKSETTINGS
+   struct ethtool_cmd ecmd;
++#define _KSETTINGS(x, y) (x)
++#else
++  struct ethtool_link_ksettings ekmd;
++#define _KSETTINGS(x, y) (y)
++#endif
+   int len = size;
+   int n;
+ 
+@@ -3933,11 +3939,11 @@ static int ethtool_drvinfo(unsigned char *ptr, size_t 
size, struct net_device *d
+   /* only get_settings for running devices to not trigger link 
negotiation */
+   if (dev->flags & IFF_UP &&
+   dev->flags & IFF_RUNNING &&
+-  !__ethtool_get_settings(dev, )) {
++  !_KSETTINGS(__ethtool_get_settings(dev, ), 
__ethtool_get_link_ksettings(dev, ))) {
+   char *s, *p;
+ 
+   /* append basic parameters: speed and port */
+-  switch (ethtool_cmd_speed()) {
++  switch (_KSETTINGS(ethtool_cmd_speed(), ekmd.base.speed)) {
+   case SPEED_1: s = "10Gb"; break;
+   case SPEED_2500:  s = "2.5Gb"; break;
+   case SPEED_1000:  s = "1Gb"; break;
+@@ -3945,7 +3951,7 @@ static int ethtool_drvinfo(unsigned char *ptr, size_t 
size, struct net_device *d
+   case SPEED_10:s = "10Mb"; break;
+   default:  s = "";
+   }
+-  switch (ecmd.port) {
++  switch (_KSETTINGS(ecmd.port, ekmd.base.port)) {
+   case PORT_TP: p = "tp"; break;
+   case PORT_AUI:p = "aui"; break;
+   case PORT_MII:p = "mii"; break;
+@@ -3964,6 +3970,7 @@ ret:
+   ops->complete(dev);
+   return size - len;
+ }
++#undef _KSETTINGS
+ 
+ static const unsigned short netdev_type[] =
+ {ARPHRD_NETROM, ARPHRD_ETHER, ARPHRD_AX25,

diff --git a/net-firewall/ipt_netflow/ipt_netflow-2.2-r1.ebuild 
b/net-firewall/ipt_netflow/ipt_netflow-2.2-r1.ebuild
new file mode 100644
index 000..a141c1a
--- /dev/null
+++ b/net-firewall/ipt_netflow/ipt_netflow-2.2-r1.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+MY_PN="${PN/_/-}"
+MY_P="${MY_PN}-${PV}"
+inherit linux-info linux-mod toolchain-funcs
+
+DESCRIPTION="Netflow iptables module"
+HOMEPAGE="http://sourceforge.net/projects/ipt-netflow;
+SRC_URI="mirror://sourceforge/${MY_PN}/${MY_P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="debug snmp"
+
+RDEPEND="
+   net-firewall/iptables
+   snmp? ( net-analyzer/net-snmp )
+"
+DEPEND="${RDEPEND}
+   virtual/linux-sources
+   virtual/pkgconfig
+"
+
+# set S before MODULE_NAMES
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+   BUILD_TARGETS="all"
+   MODULE_NAMES="ipt_NETFLOW(ipt_netflow:${S})"
+   IPT_LIB="/usr/$(get_libdir)/xtables"
+   local CONFIG_CHECK="~IP_NF_IPTABLES"
+   use debug && CONFIG_CHECK+=" ~DEBUG_FS"
+   linux-mod_pkg_setup
+}
+
+src_prepare() {
+   sed -i \
+   -e 's:make -C:$(MAKE) -C:g' \
+   -e 's:gcc -O2:$(CC) $(CFLAGS) $(LDFLAGS):' \
+   -e 's:gcc:$(CC) $(CFLAGS) $(LDFLAGS):' \
+   Makefile.in || die
+
+   # Checking for directory is enough
+   sed -i -e 's:-s /etc/snmp/snmpd.conf:-d /etc/snmp:' configure || die
+
+   # bug #455984
+   eapply "${FILESDIR}/${PN}-2.0-configure.patch"
+
+   # Compatibility with kernel 4.6
+   eapply "${FILESDIR}/${P}-linux-4.6.patch"
+
+