All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Phil Sutter <phil@nwl.cc>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>,
	netfilter-devel@vger.kernel.org, Eric Garver <e@erig.me>
Subject: Re: [nft PATCH] datatype: Accept IPv4 addresses for ip6addr_type
Date: Wed, 10 Dec 2025 23:08:30 +0100	[thread overview]
Message-ID: <aTnvXiYTlQtqVvug@strlen.de> (raw)
In-Reply-To: <20251210214945.31389-1-phil@nwl.cc>

Phil Sutter <phil@nwl.cc> wrote:
> Complement on-demand ip {s,d}addr expression conversion to IPv4-mapped
> IPv6 by accepting IPv4 addresses in places where an IPv6 one is
> expected. This way users don't have to use IPv4-mapped notation when
> populating sets.
> 
> In order to avoid chaos and breakage, prevent host names (temporarily)
> resolving to IPv4 addresses only from being accepted as IPv6 address.
> Map IPv4 addresses only if users explicitly specified them.

There is a usability issue here that I did not consider.

> -dnat ip6 to 1.2.3.4;fail
> +dnat ip6 to 1.2.3.4;ok;dnat ip6 to ::ffff:1.2.3.4

Pablo, what do you think about this?

I think nft should always return an error here.
I don't see how this makes sense (implicit dnat to a
mapped address).

Phil/Pablo, do you see a way to limit the 1.2.3.4 -> ::ffff:1.2.3.4
expansion to 'add element' ?

Alternatively we could just force users to manually expand the address
when adding ipv4 addresses to ip6_addr sets, but I think its cumbersome.

  reply	other threads:[~2025-12-10 22:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-10 21:49 [nft PATCH] datatype: Accept IPv4 addresses for ip6addr_type Phil Sutter
2025-12-10 22:08 ` Florian Westphal [this message]
2025-12-11  0:32   ` Phil Sutter
2025-12-11  0:57     ` Florian Westphal

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=aTnvXiYTlQtqVvug@strlen.de \
    --to=fw@strlen.de \
    --cc=e@erig.me \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=phil@nwl.cc \
    /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.