summaryrefslogtreecommitdiffstats
path: root/net/netfilter
diff options
context:
space:
mode:
authorTyrone Wu <wudevelops@gmail.com>2024-10-11 19:32:51 +0000
committerDaniel Borkmann <daniel@iogearbox.net>2024-10-16 17:04:33 +0200
commit92f3715e1eba1d41e55be06159dc3d856b18326d (patch)
tree7f2a97444989da13bbea87aa83d42e1ab6d8dcaa /net/netfilter
parentee230090f62fbb1c63c7f305d57289ab753221ef (diff)
downloadlinux-stable-92f3715e1eba1d41e55be06159dc3d856b18326d.tar.gz
linux-stable-92f3715e1eba1d41e55be06159dc3d856b18326d.tar.bz2
linux-stable-92f3715e1eba1d41e55be06159dc3d856b18326d.zip
bpf: Fix link info netfilter flags to populate defrag flag
This fix correctly populates the `bpf_link_info.netfilter.flags` field when user passes the `BPF_F_NETFILTER_IP_DEFRAG` flag. Fixes: 91721c2d02d3 ("netfilter: bpf: Support BPF_F_NETFILTER_IP_DEFRAG in netfilter link") Signed-off-by: Tyrone Wu <wudevelops@gmail.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Florian Westphal <fw@strlen.de> Cc: Daniel Xu <dxu@dxuuu.xyz> Link: https://lore.kernel.org/bpf/20241011193252.178997-1-wudevelops@gmail.com
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/nf_bpf_link.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/netfilter/nf_bpf_link.c b/net/netfilter/nf_bpf_link.c
index 5257d5e7eb09..797fe8a9971e 100644
--- a/net/netfilter/nf_bpf_link.c
+++ b/net/netfilter/nf_bpf_link.c
@@ -150,11 +150,12 @@ static int bpf_nf_link_fill_link_info(const struct bpf_link *link,
struct bpf_link_info *info)
{
struct bpf_nf_link *nf_link = container_of(link, struct bpf_nf_link, link);
+ const struct nf_defrag_hook *hook = nf_link->defrag_hook;
info->netfilter.pf = nf_link->hook_ops.pf;
info->netfilter.hooknum = nf_link->hook_ops.hooknum;
info->netfilter.priority = nf_link->hook_ops.priority;
- info->netfilter.flags = 0;
+ info->netfilter.flags = hook ? BPF_F_NETFILTER_IP_DEFRAG : 0;
return 0;
}