Linux Netfilter development
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
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 00:17:56 +0200	[thread overview]
Message-ID: <aguQFExPbJtWeapP@strlen.de> (raw)
In-Reply-To: <20260518194752.1063189-1-pablo@netfilter.org>

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.

  reply	other threads:[~2026-05-18 22:29 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 [this message]
2026-05-19  8:03   ` Pablo Neira Ayuso

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=aguQFExPbJtWeapP@strlen.de \
    --to=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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