From: Phil Sutter <phil@nwl.cc>
To: Florian Westphal <fw@strlen.de>
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: Thu, 11 Dec 2025 01:32:30 +0100 [thread overview]
Message-ID: <aToRHispbspGtCY0@orbyte.nwl.cc> (raw)
In-Reply-To: <aTnvXiYTlQtqVvug@strlen.de>
On Wed, Dec 10, 2025 at 11:08:30PM +0100, Florian Westphal wrote:
> 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' ?
It might be possible for dnat statement to set a flag in eval phase
controlling ip6addr_type_parse() strictness. This should work even with
an anonymous map, e.g.
| dnat ip6 to ip6 saddr map { fec0::1 : 1.2.3.4 }
But this could also be a named map and we probably don't want to check
how it's used before accepting an element.
So all this kind of opens pandora's box and we probably either have to
accept the new ways for users to shoot their feet or:
> Alternatively we could just force users to manually expand the address
> when adding ipv4 addresses to ip6_addr sets, but I think its cumbersome.
Cheers, Phil
next prev parent reply other threads:[~2025-12-11 0:32 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
2025-12-11 0:32 ` Phil Sutter [this message]
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=aToRHispbspGtCY0@orbyte.nwl.cc \
--to=phil@nwl.cc \
--cc=e@erig.me \
--cc=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 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.