[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABFUUZG9LnhXc+nsQA28WHiiT33_5wQ82E1bBSBncWkxkXaKZA@mail.gmail.com>
Date: Wed, 4 Feb 2026 00:19:40 +0800
From: sun jian <sun.jian.kdev@...il.com>
To: Florian Westphal <fw@...len.de>
Cc: Pablo Neira Ayuso <pablo@...filter.org>, Phil Sutter <phil@....cc>, Simon Horman <horms@...nel.org>,
netfilter-devel@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] netfilter: amanda: fix RCU pointer typing for nf_nat_amanda_hook
On Tue, Feb 3, 2026 at 11:04 PM Florian Westphal <fw@...len.de> wrote:
>
> Sun Jian <sun.jian.kdev@...il.com> wrote:
> > enum amanda_strings {
> > @@ -98,7 +98,12 @@ static int amanda_help(struct sk_buff *skb,
> > u_int16_t len;
> > __be16 port;
> > int ret = NF_ACCEPT;
> > - typeof(nf_nat_amanda_hook) nf_nat_amanda;
> > + unsigned int (*nf_nat_amanda)(struct sk_buff *skb,
> > + enum ip_conntrack_info ctinfo,
> > + unsigned int protoff,
> > + unsigned int matchoff,
> > + unsigned int matchlen,
> > + struct nf_conntrack_expect *exp);
>
> Why is that needed?
Correct. Manual declaration is indeed verbose.
The reason I used it was that typeof(nf_nat_amanda_hook) carries over
the __rcu attribute to the local variable, which triggers a Sparse
warning when assigning the result of rcu_dereference().
I will switch to typeof(*nf_nat_amanda_hook) *nf_nat_amanda in V3.
Thanks for the guidance!
Regards,
Sun
Powered by blists - more mailing lists