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

2021-12-16 Thread Sam James
commit: 47dba6226b616c192fd3fb9d0f37ec2945498f60
Author: Sam James  gentoo  org>
AuthorDate: Thu Dec 16 22:36:56 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Dec 16 22:37:00 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=47dba622

net-firewall/ipt_netflow: fix build with linux-headers-5.14

Closes: https://bugs.gentoo.org/813993
Signed-off-by: Sam James  gentoo.org>

 .../ipt_netflow-2.6-fix-linux-headers-5.14.patch   | 29 ++
 net-firewall/ipt_netflow/ipt_netflow-2.6.ebuild|  2 ++
 2 files changed, 31 insertions(+)

diff --git 
a/net-firewall/ipt_netflow/files/ipt_netflow-2.6-fix-linux-headers-5.14.patch 
b/net-firewall/ipt_netflow/files/ipt_netflow-2.6-fix-linux-headers-5.14.patch
new file mode 100644
index ..0f52b68d5235
--- /dev/null
+++ 
b/net-firewall/ipt_netflow/files/ipt_netflow-2.6-fix-linux-headers-5.14.patch
@@ -0,0 +1,29 @@
+https://github.com/aabc/ipt-netflow/commit/66e4304101010108892376866334ec9317b427d8.patch
+https://bugs.gentoo.org/813993
+
+From: ABC 
+Date: Wed, 14 Jul 2021 15:39:42 +0300
+Subject: [PATCH] Namespace sk_error_report
+
+sk_error_report is introduced in v5.14-rc1: e3ae2365efc14 ("net: sock:
+introduce sk_error_report").
+--- a/ipt_NETFLOW.c
 b/ipt_NETFLOW.c
+@@ -1943,7 +1943,7 @@ static struct ctl_path netflow_sysctl_path[] = {
+ #endif /* CONFIG_SYSCTL */
+ 
+ /* socket code */
+-static void sk_error_report(struct sock *sk)
++static void netflow_sk_error_report(struct sock *sk)
+ {
+   struct ipt_netflow_sock *usock;
+ 
+@@ -1974,7 +1974,7 @@ static struct socket *usock_open_sock(struct 
ipt_netflow_sock *usock)
+   }
+   sock->sk->sk_allocation = GFP_ATOMIC;
+   sock->sk->sk_prot->unhash(sock->sk); /* hidden from input */
+-  sock->sk->sk_error_report = _error_report; /* clear ECONNREFUSED */
++  sock->sk->sk_error_report = _sk_error_report; /* clear 
ECONNREFUSED */
+   sock->sk->sk_user_data = usock;
+   sock->sk->sk_reuse = SK_CAN_REUSE;
+ 

diff --git a/net-firewall/ipt_netflow/ipt_netflow-2.6.ebuild 
b/net-firewall/ipt_netflow/ipt_netflow-2.6.ebuild
index 35009fb8ac17..4665d475be3d 100644
--- a/net-firewall/ipt_netflow/ipt_netflow-2.6.ebuild
+++ b/net-firewall/ipt_netflow/ipt_netflow-2.6.ebuild
@@ -32,6 +32,8 @@ PATCHES=(
"${FILESDIR}/${PN}-2.0-configure.patch" # bug #455984
"${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() {



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

2021-07-05 Thread Sergey Popov
commit: 205596a0f676638bc1fa3a4f6b552b984c98a5d4
Author: Sergey Popov  gentoo  org>
AuthorDate: Mon Jul  5 14:20:50 2021 +
Commit: Sergey Popov  gentoo  org>
CommitDate: Mon Jul  5 14:21:10 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=205596a0

net-firewall/ipt_netflow: backport fix regarding obsolete ref_module call

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

 .../files/ipt_netflow-2.6-ref_module_fix.patch | 60 ++
 net-firewall/ipt_netflow/ipt_netflow-2.6.ebuild|  1 +
 2 files changed, 61 insertions(+)

diff --git 
a/net-firewall/ipt_netflow/files/ipt_netflow-2.6-ref_module_fix.patch 
b/net-firewall/ipt_netflow/files/ipt_netflow-2.6-ref_module_fix.patch
new file mode 100644
index 000..21d64719070
--- /dev/null
+++ b/net-firewall/ipt_netflow/files/ipt_netflow-2.6-ref_module_fix.patch
@@ -0,0 +1,60 @@
+commit 352cdb28eecbb57de3509b18dfc37dcce0455c01
+Author: ABC 
+Date:   Tue Jun 22 19:07:02 2021 +0300
+
+Fix compile for stable kernels by not using 'ref_module'
+
+`ref_module' unexport in 7ef5264de7732 ("modules: mark ref_module
+static") is back-ported into stable kernels making old `#if
+LINUX_VERSION_CODE' checks irrelevant or too complicated to update.
+
+Do not use `ref_module' API at all since `try_module_get' is ancient
+enough to use always.
+
+Reported-by: https://github.com/xtaran
+Fixes: https://github.com/aabc/ipt-netflow/issues/177
+
+diff --git a/compat.h b/compat.h
+index 99edf91..30f1d8f 100644
+--- a/compat.h
 b/compat.h
+@@ -170,10 +170,6 @@ static int __ethtool_get_settings(struct net_device *dev, 
struct ethtool_cmd *cm
+ # define CHECK_OK 0
+ #endif
+ 
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)
+-# define use_module   ref_module
+-#endif
+-
+ #ifndef NF_IP_LOCAL_IN /* 2.6.25 */
+ # define NF_IP_PRE_ROUTINGNF_INET_PRE_ROUTING
+ # define NF_IP_LOCAL_IN   NF_INET_LOCAL_IN
+diff --git a/ipt_NETFLOW.c b/ipt_NETFLOW.c
+index d3d3901..c4c049d 100644
+--- a/ipt_NETFLOW.c
 b/ipt_NETFLOW.c
+@@ -5494,12 +5494,8 @@ static void register_ct_events(void)
+   }
+   /* Reference netlink module to prevent it's unsafe unload before us. */
+   if (!netlink_m && (netlink_m = find_module(NETLINK_M))) {
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(5,9,0)
+-  use_module(THIS_MODULE, netlink_m);
+-#else
+   if (!try_module_get(netlink_m))
+   netlink_m = NULL;
+-#endif
+   }
+ 
+   /* Register ct events callback. */
+@@ -5527,10 +5523,9 @@ static void unregister_ct_events(void)
+ #else /* < v3.2 */
+   unset_notifier_cb();
+ #endif /* v3.2 */
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0)
+   module_put(netlink_m);
+   netlink_m = NULL;
+-#endif
++
+   rcu_assign_pointer(saved_event_cb, NULL);
+ #else /* < v2.6.31 */
+   nf_conntrack_unregister_notifier(_notifier);

diff --git a/net-firewall/ipt_netflow/ipt_netflow-2.6.ebuild 
b/net-firewall/ipt_netflow/ipt_netflow-2.6.ebuild
index 29ed265510f..35009fb8ac1 100644
--- a/net-firewall/ipt_netflow/ipt_netflow-2.6.ebuild
+++ b/net-firewall/ipt_netflow/ipt_netflow-2.6.ebuild
@@ -31,6 +31,7 @@ BDEPEND="
 PATCHES=(
"${FILESDIR}/${PN}-2.0-configure.patch" # bug #455984
"${FILESDIR}/${PN}-2.6-gentoo.patch"
+   "${FILESDIR}/${P}-ref_module_fix.patch" # bug #781014
 )
 
 pkg_setup() {



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

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

net-firewall/ipt_netflow: Version 2.5

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

 net-firewall/ipt_netflow/Manifest  |   1 +
 .../ipt_netflow/files/ipt_netflow-2.5-gentoo.patch |  61 
 net-firewall/ipt_netflow/ipt_netflow-2.5.ebuild| 104 +
 3 files changed, 166 insertions(+)

diff --git a/net-firewall/ipt_netflow/Manifest 
b/net-firewall/ipt_netflow/Manifest
index ee990a70dbd..79bf94164a9 100644
--- a/net-firewall/ipt_netflow/Manifest
+++ b/net-firewall/ipt_netflow/Manifest
@@ -1 +1,2 @@
 DIST ipt_netflow-2.4.tar.gz 92580 BLAKE2B 
0197e7e5cdd9c94c7b80b38cb4e2879343139592421922bf73aeaac70ac3af54ea25934bb1474ff455a9f58eab2368995591542f46be48b5c8491a3b6a192f56
 SHA512 
3c80d02cfda996fbde8d258875df8795000fd8390b5a6f8296771a992067e153eca48f7f4602421529948beaf3030e164adfc2ffe5b528042fbdc15ffb56aa74
+DIST ipt_netflow-2.5.tar.gz 94097 BLAKE2B 
5ca8d686e08f6fb0cdb1d502572afc71f146e2633ccf5fc7cb9ad21420fb62e88a2cb393e83ee4f5646200fa964d46a16ef58831958799449a4a59e2da6c9337
 SHA512 
8cd1bc46ef6e975964e5ddc290ed999f7076b63a9363f1a1f31b5d8db875d4e564ed5f0d5185c29dcf8a86793fe4badf63325b79ba1abbc264088b1ca94a9dad

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
new file mode 100644
index 000..508be107795
--- /dev/null
+++ b/net-firewall/ipt_netflow/files/ipt_netflow-2.5-gentoo.patch
@@ -0,0 +1,61 @@
+--- 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/ipt_netflow-2.5.ebuild 
b/net-firewall/ipt_netflow/ipt_netflow-2.5.ebuild
new file mode 100644
index 000..d5ba624302b
--- /dev/null
+++ b/net-firewall/ipt_netflow/ipt_netflow-2.5.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2020 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}
+   virtual/linux-sources
+   virtual/pkgconfig
+"
+PATCHES=(
+   "${FILESDIR}/${PN}-2.0-configure.patch" # bug #455984
+   "${FILESDIR}/${PN}-2.5-gentoo.patch"
+)
+
+pkg_setup() {
+   

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

2019-06-19 Thread Jeroen Roovers
commit: 5ec2dcfdfa639c7daffc1d068af45ed67cb0a58f
Author: Jeroen Roovers  gentoo  org>
AuthorDate: Wed Jun 19 06:11:57 2019 +
Commit: Jeroen Roovers  gentoo  org>
CommitDate: Wed Jun 19 06:12:13 2019 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ec2dcfd

net-firewall/ipt_netflow: Fix USE=snmp

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

 .../ipt_netflow/files/ipt_netflow-2.3-flags.patch  | 55 ++
 .../ipt_netflow/ipt_netflow-2.3_p20190619.ebuild   | 11 +
 net-firewall/ipt_netflow/ipt_netflow-.ebuild   | 11 +
 3 files changed, 59 insertions(+), 18 deletions(-)

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
new file mode 100644
index 000..0d89e5ba90a
--- /dev/null
+++ b/net-firewall/ipt_netflow/files/ipt_netflow-2.3-flags.patch
@@ -0,0 +1,55 @@
+--- 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/ipt_netflow-2.3_p20190619.ebuild 
b/net-firewall/ipt_netflow/ipt_netflow-2.3_p20190619.ebuild
index 07ddf25ef1d..3a1ad78c15f 100644
--- a/net-firewall/ipt_netflow/ipt_netflow-2.3_p20190619.ebuild
+++ b/net-firewall/ipt_netflow/ipt_netflow-2.3_p20190619.ebuild
@@ -25,10 +25,9 @@ DEPEND="${RDEPEND}
virtual/linux-sources
virtual/pkgconfig
 "
-
-# set S before MODULE_NAMES
 PATCHES=(
"${FILESDIR}/${PN}-2.0-configure.patch" # bug #455984
+   "${FILESDIR}/${PN}-2.3-flags.patch"
 )
 
 pkg_setup() {
@@ -48,19 +47,13 @@ src_unpack() {
 }
 
 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
+   default
 
# Fix incorrect module version in sources
sed -i -e "/IPT_NETFLOW_VERSION/s/2.2/${PV}/" ipt_NETFLOW.c || die
 
# Checking for directory is enough
sed -i -e 's:-s /etc/snmp/snmpd.conf:-d /etc/snmp:' configure || die
-
-   default
 }
 
 do_conf() {

diff --git a/net-firewall/ipt_netflow/ipt_netflow-.ebuild 
b/net-firewall/ipt_netflow/ipt_netflow-.ebuild
index 6d8feeb6e0a..2a4bba4304b 100644
--- a/net-firewall/ipt_netflow/ipt_netflow-.ebuild
+++ b/net-firewall/ipt_netflow/ipt_netflow-.ebuild
@@ -25,10 +25,9 @@ DEPEND="${RDEPEND}
virtual/linux-sources
virtual/pkgconfig
 "
-
-# set S before MODULE_NAMES
 PATCHES=(
"${FILESDIR}/${PN}-2.0-configure.patch" # bug #455984
+   "${FILESDIR}/${PN}-2.3-flags.patch"
 )
 
 pkg_setup() {
@@ -42,19 +41,13 @@ 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
+   default
 
# Fix incorrect module version in sources
sed -i -e "/IPT_NETFLOW_VERSION/s/2.2/${PV}/" ipt_NETFLOW.c || die
 
# Checking 

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

2017-09-11 Thread Sergey Popov
commit: 3c5c24508b5a3faed392e546e2acdd684e28fdd1
Author: Sergey Popov  gentoo  org>
AuthorDate: Mon Sep 11 09:32:01 2017 +
Commit: Sergey Popov  gentoo  org>
CommitDate: Mon Sep 11 09:33:45 2017 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c5c2450

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

Reported-by: Toralf Förster  gentoo.org>
Closes: https://bugs.gentoo.org/630446

Package-Manager: Portage-2.3.7, Repoman-2.3.1

 .../files/ipt_netflow-2.2-linux-4.13.patch | 63 ++
 net-firewall/ipt_netflow/ipt_netflow-2.2-r1.ebuild |  3 ++
 2 files changed, 66 insertions(+)

diff --git a/net-firewall/ipt_netflow/files/ipt_netflow-2.2-linux-4.13.patch 
b/net-firewall/ipt_netflow/files/ipt_netflow-2.2-linux-4.13.patch
new file mode 100644
index 000..10e8b552afb
--- /dev/null
+++ b/net-firewall/ipt_netflow/files/ipt_netflow-2.2-linux-4.13.patch
@@ -0,0 +1,63 @@
+commit 53a556cb4a705f4eae2bcb49552b6427b231378a
+Author: ABC 
+Date:   Mon Aug 14 22:55:25 2017 +0300
+
+Compatibility with kernel 4.13.
+
+Offset patch torvalds/linux@14afee4b6092fde451ee17604e5f5c89da33e71e
+
+diff --git a/compat.h b/compat.h
+index 061eb57..275ff58 100644
+--- a/compat.h
 b/compat.h
+@@ -636,4 +636,10 @@ static inline unsigned int xt_hooknum(const struct 
xt_action_param *par)
+ # define SK_CAN_REUSE   1
+ #endif
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,13,0)
++# define compat_refcount_read atomic_read
++#else
++# define compat_refcount_read refcount_read
++#endif
++
+ #endif /* COMPAT_NETFLOW_H */
+diff --git a/ipt_NETFLOW.c b/ipt_NETFLOW.c
+index 494ea74..9365325 100644
+--- a/ipt_NETFLOW.c
 b/ipt_NETFLOW.c
+@@ -622,7 +622,7 @@ static int snmp_seq_show(struct seq_file *seq, void *v)
+ 
+   seq_printf(seq, " %u %u %u\n",
+   sk->sk_sndbuf,
+-  atomic_read(>sk_wmem_alloc),
++  compat_refcount_read(>sk_wmem_alloc),
+   wmem_peak);
+   } else
+   seq_printf(seq, " 0 0 %u\n", wmem_peak);
+@@ -864,7 +864,7 @@ static int nf_seq_show(struct seq_file *seq, void *v)
+   seq_printf(seq, ", sndbuf %u, filled %u, peak %u;"
+   " err: sndbuf reached %u, connect %u, cberr %u, 
other %u\n",
+   sk->sk_sndbuf,
+-  atomic_read(>sk_wmem_alloc),
++  compat_refcount_read(>sk_wmem_alloc),
+   atomic_read(>wmem_peak),
+   usock->err_full,
+   usock->err_connect,
+@@ -2031,7 +2031,7 @@ static void netflow_sendmsg(void *buffer, const int len)
+   printk(KERN_INFO "netflow_sendmsg: sendmsg(%d, %d) [%u 
%u]\n",
+  snum,
+  len,
+- atomic_read(>sock->sk->sk_wmem_alloc),
++ 
compat_refcount_read(>sock->sk->sk_wmem_alloc),
+  usock->sock->sk->sk_sndbuf);
+   ret = kernel_sendmsg(usock->sock, , , 1, (size_t)len);
+   if (ret < 0) {
+@@ -2054,7 +2054,7 @@ static void netflow_sendmsg(void *buffer, const int len)
+   printk(KERN_ERR "ipt_NETFLOW: sendmsg[%d] error %d: 
data loss %llu pkt, %llu bytes%s\n",
+  snum, ret, pdu_packets, pdu_traf, suggestion);
+   } else {
+-  unsigned int wmem = 
atomic_read(>sock->sk->sk_wmem_alloc);
++  unsigned int wmem = 
compat_refcount_read(>sock->sk->sk_wmem_alloc);
+   if (wmem > atomic_read(>wmem_peak))
+   atomic_set(>wmem_peak, wmem);
+   NETFLOW_STAT_INC(exported_pkt);

diff --git a/net-firewall/ipt_netflow/ipt_netflow-2.2-r1.ebuild 
b/net-firewall/ipt_netflow/ipt_netflow-2.2-r1.ebuild
index d7f364065e3..f82263fe40c 100644
--- a/net-firewall/ipt_netflow/ipt_netflow-2.2-r1.ebuild
+++ b/net-firewall/ipt_netflow/ipt_netflow-2.2-r1.ebuild
@@ -56,6 +56,9 @@ src_prepare() {
# Compatibility with kernel 4.10, bug #617484
eapply "${FILESDIR}/${P}-linux-4.10.patch"
 
+   # Compatibility with kernel 4.13, bug #630446
+   eapply "${FILESDIR}/${P}-linux-4.13.patch"
+
eapply_user
 }
 



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

2016-07-19 Thread Sergey Popov
commit: d45e06d1e8292e123fa7e7420dd6c7b387da9383
Author: Sergey Popov  gentoo  org>
AuthorDate: Tue Jul 19 09:12:41 2016 +
Commit: Sergey Popov  gentoo  org>
CommitDate: Tue Jul 19 09:12:41 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d45e06d1

net-firewall/ipt_netflow: drop old version

Package-Manager: portage-2.2.28

 net-firewall/ipt_netflow/Manifest  |  1 -
 .../files/ipt_netflow-2.1-linux-3.19.patch | 45 ---
 .../ipt_netflow/ipt_netflow-2.1_p20160119.ebuild   | 88 --
 3 files changed, 134 deletions(-)

diff --git a/net-firewall/ipt_netflow/Manifest 
b/net-firewall/ipt_netflow/Manifest
index 1dba461..65a6cfc 100644
--- a/net-firewall/ipt_netflow/Manifest
+++ b/net-firewall/ipt_netflow/Manifest
@@ -1,2 +1 @@
-DIST ipt-netflow-2.1_p20160119.tgz 86892 SHA256 
9afb3f122f0f2b140d81b331d4500f8ad475898579fb5901ed1090d80783a4e5 SHA512 
7f30683240d7516df01a4b4a37ea738980def764741c658c86e9c28ca638592a40e0b2458164105d76f88c90f780f058f5c17a0c60ffaeb775d7cdb38dbb4fe1
 WHIRLPOOL 
fdb1a0bebeb8a2840005abd86cbd0fcbc241b4acaae2138d66d0a463807392a3076113b61d8d091ba0aa8f995ab9cc21a1f1f8e33bd9cd11bc1700b8392791d9
 DIST ipt-netflow-2.2.tgz 96697 SHA256 
81be0a334f74894756d022aee2c87b36c89a7aeca6ff1c91ef6b4f3458793198 SHA512 
a406ab9bd18616414d8c99f427382a075bdb8000d8c40959f5b6d6e577d7eb4dfc7f8b773664a516ec2228d15590f21c3fbd6aa3d4302f6cdf03810e1702af74
 WHIRLPOOL 
e9c5f13a3efa346b75ec47ceb033e83099744fa90d575d62135225a88f0093b1de556354d972772f13e7ea895659cd58e6e9a3c08817f62fd902336cc8771928

diff --git a/net-firewall/ipt_netflow/files/ipt_netflow-2.1-linux-3.19.patch 
b/net-firewall/ipt_netflow/files/ipt_netflow-2.1-linux-3.19.patch
deleted file mode 100644
index 47fec4f..000
--- a/net-firewall/ipt_netflow/files/ipt_netflow-2.1-linux-3.19.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-commit 582fd497a5f0f5ae5dce24cba042d856d63bfbe1
-Author: ABC 
-Date:   Mon Feb 16 21:53:54 2015 +0400
-
-Compatibility of __get_cpu_var with linux 3.19.
-
-Fixes #28, thanks boyarsh@github.
-
-diff --git a/ipt_NETFLOW.h b/ipt_NETFLOW.h
-index bc2734f..5548e57 100644
 a/ipt_NETFLOW.h
-+++ b/ipt_NETFLOW.h
-@@ -396,6 +396,9 @@ struct netflow_aggr_p {
-   __u16 aggr_port;
- };
- 
-+#ifndef __get_cpu_var
-+#define __get_cpu_var(var)(*this_cpu_ptr(&(var)))
-+#endif
- #define NETFLOW_STAT_INC(count) (__get_cpu_var(ipt_netflow_stat).count++)
- #define NETFLOW_STAT_ADD(count, val) (__get_cpu_var(ipt_netflow_stat).count 
+= (unsigned long long)val)
- #define NETFLOW_STAT_SET(count, val) (__get_cpu_var(ipt_netflow_stat).count = 
(unsigned long long)val)
-diff --git a/testing.sh b/testing.sh
-index b465c8d..caa4f03 100755
 a/testing.sh
-+++ b/testing.sh
-@@ -6,7 +6,7 @@ if [ "$1" = "" ]; then
-   echo Maintainer only tool.
-   exit 1
- elif [ "$1" = all ]; then
--  exec bash $0 linux-2.6.18 centos5 linux-3.11.2 centos6 linux-3.4.66 
linux-3.9.11 centos7 linux-3.14 linux-3.17
-+  exec bash $0 linux-2.6.18 centos5 linux-3.11.2 centos6 linux-3.4.66 
linux-3.9.11 centos7 linux-3.14 linux-3.17 linux-3.19
-   exit 1
- fi
- 
-@@ -33,6 +33,9 @@ readarray -t opts