Linux Netfilter development
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 4/3 nf,v4] netfilter: nf_conntrack_helper: call .destroy() when helper is unregistered
Date: Tue, 19 May 2026 10:03:43 +0200	[thread overview]
Message-ID: <agwZX77SWnd6CzCs@chamomile> (raw)
In-Reply-To: <aguQFExPbJtWeapP@strlen.de>

On Tue, May 19, 2026 at 12:17:56AM +0200, Florian Westphal wrote:
> Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > When the helper is removed, call .destroy to release the pptp binding
> > with gre conntrack entries, otherwise the gre keymap stays with stale
> > list entries.
> > 
> > Fixes: f09943fefe6b ("[NETFILTER]: nf_conntrack/nf_nat: add PPTP helper port")
> > Reported-by: Florian Westphal <fw@strlen.de>
> > Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
> > ---
> >  net/netfilter/nf_conntrack_helper.c | 10 +++++++++-
> >  1 file changed, 9 insertions(+), 1 deletion(-)
> > 
> > diff --git a/net/netfilter/nf_conntrack_helper.c b/net/netfilter/nf_conntrack_helper.c
> > index 9a10b3449957..b226291a5c7f 100644
> > --- a/net/netfilter/nf_conntrack_helper.c
> > +++ b/net/netfilter/nf_conntrack_helper.c
> > @@ -241,9 +241,17 @@ EXPORT_SYMBOL_GPL(__nf_ct_try_assign_helper);
> >  static int unhelp(struct nf_conn *ct, void *me)
> >  {
> >  	struct nf_conn_help *help = nfct_help(ct);
> > +	struct nf_conntrack_helper *helper;
> > +
> > +	if (!help)
> > +		return 0;
> >  
> > -	if (help && rcu_dereference_raw(help->helper) == me) {
> > +	helper = rcu_dereference_raw(help->helper);
> > +	if (helper == me) {
> >  		nf_conntrack_event(IPCT_HELPER, ct);
> > +		if (helper->destroy)
> > +			helper->destroy(ct);
> > +
> 
> There is a nf_ct_helper_destroy() helper that could be used here instead
> of open-coding.  Other than that this looks correct.

Yes, but it is refetching the helper again which seems redundant to
me. I can use it if you prefer though.

      reply	other threads:[~2026-05-19  8:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-18 19:47 [PATCH 4/3 nf,v4] netfilter: nf_conntrack_helper: call .destroy() when helper is unregistered Pablo Neira Ayuso
2026-05-18 22:17 ` Florian Westphal
2026-05-19  8:03   ` Pablo Neira Ayuso [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=agwZX77SWnd6CzCs@chamomile \
    --to=pablo@netfilter.org \
    --cc=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox