Skip to content

Commit 92f3715

Browse files
ver-nyanborkmann
authored andcommitted
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: 91721c2 ("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
1 parent ee23009 commit 92f3715

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

net/netfilter/nf_bpf_link.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,12 @@ static int bpf_nf_link_fill_link_info(const struct bpf_link *link,
150150
struct bpf_link_info *info)
151151
{
152152
struct bpf_nf_link *nf_link = container_of(link, struct bpf_nf_link, link);
153+
const struct nf_defrag_hook *hook = nf_link->defrag_hook;
153154

154155
info->netfilter.pf = nf_link->hook_ops.pf;
155156
info->netfilter.hooknum = nf_link->hook_ops.hooknum;
156157
info->netfilter.priority = nf_link->hook_ops.priority;
157-
info->netfilter.flags = 0;
158+
info->netfilter.flags = hook ? BPF_F_NETFILTER_IP_DEFRAG : 0;
158159

159160
return 0;
160161
}

0 commit comments

Comments
 (0)