diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2018-02-26 17:49:37 +0100 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2018-02-26 17:52:15 +0100 |
commit | fc54256bc8d13cf5f314a41ce03695cb424bbee6 (patch) | |
tree | 688e8b14466f1481b7460abeeb082c77b097b465 | |
parent | 664733de8c9b2bfd34a6bf49ed152d34088a285a (diff) | |
download | upstream-fc54256bc8d13cf5f314a41ce03695cb424bbee6.tar.gz upstream-fc54256bc8d13cf5f314a41ce03695cb424bbee6.tar.bz2 upstream-fc54256bc8d13cf5f314a41ce03695cb424bbee6.zip |
iptables: fix compile with kernel 3.18
This fixes a compile bug found by build bot with kernel 3.18
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r-- | package/network/utils/iptables/patches/030-extensions-libxt_bpf-Fix-build-with-old-kernel-versi.patch | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/package/network/utils/iptables/patches/030-extensions-libxt_bpf-Fix-build-with-old-kernel-versi.patch b/package/network/utils/iptables/patches/030-extensions-libxt_bpf-Fix-build-with-old-kernel-versi.patch new file mode 100644 index 0000000000..c825eee3a9 --- /dev/null +++ b/package/network/utils/iptables/patches/030-extensions-libxt_bpf-Fix-build-with-old-kernel-versi.patch @@ -0,0 +1,40 @@ +From a12326ad330c4f7cd8d2b6ae1c4fbcd952c378dc Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens <hauke@hauke-m.de> +Date: Mon, 26 Feb 2018 17:39:09 +0100 +Subject: [PATCH] extensions: libxt_bpf: Fix build with old kernel versions + +In kernel 3.18 the union bpf_attr does not have a pathname attribute and +BPF_OBJ_GET is also not defined in these versions. +This was added in Linux commit b2197755b263 ("bpf: add support for +persistent maps/progs"). Check for the BPF_FS_MAGIC define which was +also added in this Linux commit and only activate this code in case we +find that define. + +This fixes a build problem with Linux 3.18. +Netfilter bug: #1231 + +Fixes: f17f9ace8a8 ("extensions: libxt_bpf: support ebpf pinned objects") +Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> +--- + extensions/libxt_bpf.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/extensions/libxt_bpf.c ++++ b/extensions/libxt_bpf.c +@@ -22,6 +22,7 @@ + #include <linux/bpf.h> + #endif + ++#include <linux/magic.h> + #include <linux/unistd.h> + + #define BCODE_FILE_MAX_LEN_B 1024 +@@ -62,7 +63,7 @@ static const struct xt_option_entry bpf_ + + static int bpf_obj_get(const char *filepath) + { +-#if defined HAVE_LINUX_BPF_H && defined __NR_bpf ++#if defined HAVE_LINUX_BPF_H && defined __NR_bpf && defined BPF_FS_MAGIC + union bpf_attr attr; + + memset(&attr, 0, sizeof(attr)); |