Re: [PATCH] netfilter: bpf: add missing declaration for bpf_ct_set_nat_info
From: sun jian
Date: Tue Feb 03 2026 - 08:13:01 EST
On Tue, Feb 3, 2026 at 8:56 PM Florian Westphal <fw@xxxxxxxxx> wrote:
>
> Sun Jian <sun.jian.kdev@xxxxxxxxx> wrote:
> > When building with Sparse (C=2), the following warning is reported:
> >
> > net/netfilter/nf_nat_bpf.c:31:17: warning: symbol 'bpf_ct_set_nat_info'
> > was not declared. Should it be static?
> >
> > This function is a BPF kfunc and must remain non-static to be visible
> > to the BPF verifier via BTF. However, it lacks a proper declaration
> > in the header file, which triggers the sparse warning.
> >
> > Fix this by adding the missing declaration in
> > include/net/netfilter/nf_conntrack_bpf.h inside the CONFIG_NF_NAT
> > conditional block.
>
> Didn't Alexei tell you to not send more fixes like this?
>
> https://lore.kernel.org/netfilter-devel/CAADnVQ+j8Q5+2KSsaddj3nmU1EkuRAt8XwM=zcSrfQfY+A1PsA@xxxxxxxxxxxxxx/
>
> "No. Ignore the warning. Sparse is incorrect.
> We have hundreds of such bogus warnings. Do NOT attempt to send
> more patches to "fix" them."
>
> I'm not applying patches when a subsystem maintainer already
> said no.
Sorry, I'll drop this patch.