All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Phil Sutter <phil@nwl.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:57:13 +0100	[thread overview]
Message-ID: <aToW6QiVA99zbkAe@strlen.de> (raw)
In-Reply-To: <aToRHispbspGtCY0@orbyte.nwl.cc>

Phil Sutter <phil@nwl.cc> wrote:
> > > +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.

True, but it was more of a usability question, i.e. catch ip vs ipv6
typo in 'dnat ip to 1.2.3.4'.

> | 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.

Right.

> 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:

Yes, indeed.  Or add a cast operator for this.  This was discussed
before (for other things like 'mark set ip saddr').

      reply	other threads:[~2025-12-11  0:57 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
2025-12-11  0:57     ` Florian Westphal [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=aToW6QiVA99zbkAe@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.