All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: "Fabian Bläse" <fabian@blaese.de>
Cc: netdev@vger.kernel.org, netfilter-devel@vger.kernel.org,
	"Jason A. Donenfeld" <Jason@zx2c4.com>
Subject: Re: [PATCH v2] icmp: fix icmp_ndo_send address translation for reply direction
Date: Wed, 27 Aug 2025 19:25:31 +0200	[thread overview]
Message-ID: <aK8_i-_-Kmbozl0H@strlen.de> (raw)
In-Reply-To: <e1bf6193-d075-4593-81ef-99e8b93a4f74@blaese.de>

Fabian Bläse <fabian@blaese.de> wrote:
> To avoid unnecessary translations, I suggested the direction-specific checks.
> Another option is to simplify them to:
> 
>      if (!(ct->status & IPS_NAT_MASK)) { … }

Yes, you can update the test from
        if (!ct || !(ct->status & IPS_SRC_NAT)) {

to
        if (!ct || !(ct->status & IPS_NAT_MASK)) {

Not related to your change:

I suspect there is a very small risk that kcsan could report a data
race here, given ct->status can be modified on other CPU.

But maybe, while at it, replace this with
READ_ONCE(ct->status) & ...

> Correct — the change not only fixes SNAT-in-reply handling, but also adds
> proper handling for DNAT in the reply direction, which was missing entirely.
> I will update the commit message to reflect this.

Thanks!

  reply	other threads:[~2025-08-27 17:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-25 20:17 [PATCH] icmp: fix icmp_ndo_send address translation for reply direction Fabian Bläse
2025-08-25 20:38 ` [PATCH v2] " Fabian Bläse
2025-08-27  9:05   ` Florian Westphal
2025-08-27 17:12     ` Fabian Bläse
2025-08-27 17:25       ` Florian Westphal [this message]
2025-08-28  9:14   ` [PATCH v3] " Fabian Bläse
2025-08-28 12:00     ` Pablo Neira Ayuso
2025-08-28 12:15       ` Florian Westphal
2025-08-28 12:33         ` Pablo Neira Ayuso
2025-08-28 12:48           ` Florian Westphal
2025-08-28 12:48     ` Florian Westphal
2025-09-01 20:20     ` patchwork-bot+netdevbpf

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=aK8_i-_-Kmbozl0H@strlen.de \
    --to=fw@strlen.de \
    --cc=Jason@zx2c4.com \
    --cc=fabian@blaese.de \
    --cc=netdev@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.