]> git.ipfire.org Git - thirdparty/iptables.git/commit
extensions: libxt_bpf: Fix build with old kernel versions
authorHauke Mehrtens <hauke@hauke-m.de>
Tue, 27 Feb 2018 15:56:55 +0000 (16:56 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 28 Feb 2018 18:38:19 +0000 (19:38 +0100)
commit5beb1582d13d3bfdd0d2b277f5f3154b2fbf4a8e
tree2efba0d68dad6a0cc68f0fcd94998fed1d9c3d82
parent147a891f8ca48f1f0c932ac304810d68780c90c2
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>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
extensions/libxt_bpf.c