summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Shalygin2019-11-28 15:12:43 +0700
committerKonstantin Shalygin2019-11-28 15:12:43 +0700
commitbffe36b831def2373c4fa9f7e0b0b769db386c0e (patch)
treeec61fdf99b7c99504e1689cb38d081991fdf8e20
parent18c8b0f4155de38d250e66512cbd9c704c6dfe03 (diff)
downloadaur-bffe36b831def2373c4fa9f7e0b0b769db386c0e.tar.gz
Added upstream patches for Kernel 5.3
-rw-r--r--.SRCINFO6
-rw-r--r--15190633ff9689d530543e8a31e1c05ca7e07985.patch43
-rw-r--r--96dffb2645fa08d744fcf6b172d2d88cc542389a.patch67
-rw-r--r--PKGBUILD13
4 files changed, 125 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index dffa9392c673..2d697f3b5f72 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = ipt_netflow
pkgdesc = Netflow as netfilter extension.
pkgver = 2.4
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/aabc/ipt-netflow
arch = any
license = GPL
@@ -12,7 +12,11 @@ pkgbase = ipt_netflow
depends = linux
depends = iptables
source = ipt_netflow.tar.gz::https://github.com/aabc/ipt-netflow/archive/v2.4.tar.gz
+ source = 96dffb2645fa08d744fcf6b172d2d88cc542389a.patch
+ source = 15190633ff9689d530543e8a31e1c05ca7e07985.patch
sha256sums = 6655b7dcfac6035368728e4c3a49b059f9eaa4576c2c129b75ddbe54a6efb118
+ sha256sums = 0c0f990552fd8901e7b275ed9a09a75bb3443b2295ca6485cffe0e336e886355
+ sha256sums = 31c5578ebb7d7a8981789cc506b7a5b3862bd91012d2c9fe490d03035a025e90
pkgname = ipt_netflow
diff --git a/15190633ff9689d530543e8a31e1c05ca7e07985.patch b/15190633ff9689d530543e8a31e1c05ca7e07985.patch
new file mode 100644
index 000000000000..97fbd61de72e
--- /dev/null
+++ b/15190633ff9689d530543e8a31e1c05ca7e07985.patch
@@ -0,0 +1,43 @@
+From 15190633ff9689d530543e8a31e1c05ca7e07985 Mon Sep 17 00:00:00 2001
+From: ABC <abc@openwall.com>
+Date: Sun, 10 Nov 2019 05:47:50 +0300
+Subject: [PATCH] murmur3: Add FALLTHROUGH statement to the switch.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+In file included from /tmp/ipt-netflow/ipt_NETFLOW.c:78:
+/tmp/ipt-netflow/murmur3.h: In function ‘murmur3’:
+/tmp/ipt-netflow/murmur3.h:35:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
+ 35 | case 3: k1 ^= tail[2] << 16;
+ | ~~~^~~~~~~~~~~~~~~~
+/tmp/ipt-netflow/murmur3.h:36:3: note: here
+ 36 | case 2: k1 ^= tail[1] << 8;
+ | ^~~~
+/tmp/ipt-netflow/murmur3.h:36:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
+ 36 | case 2: k1 ^= tail[1] << 8;
+ | ~~~^~~~~~~~~~~~~~~
+/tmp/ipt-netflow/murmur3.h:37:3: note: here
+ 37 | case 1: k1 ^= tail[0];
+ | ^~~~
+
+Reported-by: k0ste @ github in #129
+---
+ murmur3.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/murmur3.h b/murmur3.h
+index 57a6006..4e3377b 100644
+--- a/murmur3.h
++++ b/murmur3.h
+@@ -32,8 +32,8 @@ static inline uint32_t murmur3(const void *key, const uint32_t len, const uint32
+ }
+ tail = (const uint8_t*)blocks;
+ switch (len & 3) {
+- case 3: k1 ^= tail[2] << 16;
+- case 2: k1 ^= tail[1] << 8;
++ case 3: k1 ^= tail[2] << 16; /* FALLTHROUGH */
++ case 2: k1 ^= tail[1] << 8; /* FALLTHROUGH */
+ case 1: k1 ^= tail[0];
+ h1 ^= rotl32(k1 * c1, 15) * c2;
+ }
diff --git a/96dffb2645fa08d744fcf6b172d2d88cc542389a.patch b/96dffb2645fa08d744fcf6b172d2d88cc542389a.patch
new file mode 100644
index 000000000000..4b5d06df0307
--- /dev/null
+++ b/96dffb2645fa08d744fcf6b172d2d88cc542389a.patch
@@ -0,0 +1,67 @@
+From 96dffb2645fa08d744fcf6b172d2d88cc542389a Mon Sep 17 00:00:00 2001
+From: ABC <abc@openwall.com>
+Date: Sun, 10 Nov 2019 01:10:41 +0300
+Subject: [PATCH] Redefine CONFIG_NF_NAT_NEEDED on newer kernels.
+
+New kernels since commit torvalds/linux@4806e97 do not use NF_NAT_NEEDED
+to signify that NAT support is enabled. Redefine CONFIG_NF_NAT_NEEDED if
+it's supposed to be defened by old logic.
+
+Reference:
+ https://github.com/torvalds/linux/commit/4806e975729f99c7908d1688a143f1e16d464e6c
+
+Reported-by: k0ste @ github
+Fixes #129.
+---
+ configure | 32 +++++++++++++++++++++++++++++++-
+ 1 file changed, 31 insertions(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index 8aae8bf..567ec8b 100755
+--- a/configure
++++ b/configure
+@@ -460,13 +460,43 @@ kconfig() {
+ echo "! Attention: $1 is undefined in your kernel configuration"
+ echo "! Without this option enabled $2 will not work."
+ echo
++ return 1
++ fi
++ return 0
++}
++
++# Respond to change in https://github.com/torvalds/linux/commit/4806e975729f99
++nf_nat_needed() {
++ local INC=include/linux/netfilter.h
++
++ echo -n "Checking for presence of $INC... "
++ if [ "$KSRC" -a -e $KSRC/$INC ]; then
++ echo Yes
++ INC=$KSRC/$INC
++ elif [ -e $KDIR/$INC ]; then
++ echo Yes
++ INC=$KDIR/$INC
++ else
++ echo No
++ return 1
++ fi
++ echo -n "netfilter.h uses CONFIG_NF_NAT_NEEDED... "
++ if grep -q CONFIG_NF_NAT_NEEDED $INC; then
++ echo Yes
++ else
++ echo No
++ return 1
+ fi
+ }
+
+ kernel_check_config() {
+ kconfig CONFIG_SYSCTL "sysctl interface"
+ kconfig CONFIG_PROC_FS "proc interface"
+- kconfig CONFIG_NF_NAT_NEEDED "natevents"
++ if nf_nat_needed; then
++ kconfig CONFIG_NF_NAT_NEEDED "natevents"
++ else
++ kconfig CONFIG_NF_NAT "natevents" && KOPTS="$KOPTS -DCONFIG_NF_NAT_NEEDED"
++ fi
+ kconfig CONFIG_NF_CONNTRACK_EVENTS "natevents"
+ kconfig CONFIG_IPV6 "IPv6"
+ kconfig CONFIG_IP6_NF_IPTABLES "ip6tables target"
diff --git a/PKGBUILD b/PKGBUILD
index 13984f5c9067..28c0d55d5347 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,15 +4,19 @@
_netflow='ipt-netflow'
pkgname='ipt_netflow'
pkgver='2.4'
-pkgrel='1'
+pkgrel='2'
pkgdesc='Netflow as netfilter extension.'
arch=('any')
url="https://github.com/aabc/${_netflow}"
license=('GPL')
depends=('linux' 'iptables')
makedepends=('gcc' 'gzip' 'gawk' 'sed')
-source=("${pkgname}.tar.gz::${url}/archive/v${pkgver}.tar.gz")
-sha256sums=('6655b7dcfac6035368728e4c3a49b059f9eaa4576c2c129b75ddbe54a6efb118')
+source=("${pkgname}.tar.gz::${url}/archive/v${pkgver}.tar.gz"
+ "96dffb2645fa08d744fcf6b172d2d88cc542389a.patch"
+ "15190633ff9689d530543e8a31e1c05ca7e07985.patch")
+sha256sums=('6655b7dcfac6035368728e4c3a49b059f9eaa4576c2c129b75ddbe54a6efb118'
+ '0c0f990552fd8901e7b275ed9a09a75bb3443b2295ca6485cffe0e336e886355'
+ '31c5578ebb7d7a8981789cc506b7a5b3862bd91012d2c9fe490d03035a025e90')
# define '-lts' for linux-lts package
_linux_custom=""
_kdir="`pacman -Ql linux${_linux_custom} | awk '/(\/modules\/)([0-9.-])+-(.*)'${_linux_custom}'\/$/ {print $2}' | head -n1`"
@@ -21,6 +25,9 @@ _kver="`pacman -Ql linux${_linux_custom} | gawk 'match($0, /(\/usr\/lib\/modules
prepare() {
cd "${srcdir}/${_netflow}-${pkgver}"
+ patch -p1 -i "${srcdir}/96dffb2645fa08d744fcf6b172d2d88cc542389a.patch"
+ patch -p1 -i "${srcdir}/15190633ff9689d530543e8a31e1c05ca7e07985.patch"
+
./configure \
--disable-snmp-agent \
--disable-dkms \