All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>,
	Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next] ip6_tunnel: enable to change proto of fb tunnels
Date: Sat, 21 Jun 2025 06:54:39 -0700	[thread overview]
Message-ID: <20250621065439.0fd2b6f6@kernel.org> (raw)
In-Reply-To: <27a87dd2-7ffe-4b4e-8001-ca0abe412b3e@6wind.com>

On Fri, 20 Jun 2025 10:14:26 +0200 Nicolas Dichtel wrote:
> > Hm, I guess its in line with old school netlink behavior where we'd
> > just toss unsupported attributes on the floor. But I wonder whether
> > it'd be better to explicitly reject other attrs?  
> 
> I tried to find a (simple) way to be strict but, by default 'ip link' dumps all
> attributes and put them back in the message it sends.
> Ie, with the command 'ip link set ip6tnl0 type ip6tnl mode any' all IFLA_IPTUN_*
> attributes are set (to their current value) and only IFLA_IPTUN_PROTO has
> another value.

Ah damn.

> > Shouldn't be too painful with just one allowed:
> > 
> > 	if (!data[IFLA_IPTUN_PROTO])
> > 		goto ..
> > 
> > 	ip6_tnl_netlink_parms(data, &p);
> > 
> > 	data[IFLA_IPTUN_PROTO] = NULL;
> > 	if (memchr_inv(data, 0, sizeof() * ARRAY_SIZE(ip6_tnl_policy)))
> > 		goto ...  
> > > 	ip6_tnl0_update(netdev_priv(ip6n->fb_tnl_dev), &p);  
> > 
> > WDYT?  
> I already tried something similar, but it broke the 'ip link' command for the
> reason explained above.
> I was wondering if it's worth putting a lot of code to cover this case.
> Any thoughts?

Yes, commit message and/or even a one-line comment in the code?

      reply	other threads:[~2025-06-21 13:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-17 16:01 [PATCH net-next] ip6_tunnel: enable to change proto of fb tunnels Nicolas Dichtel
2025-06-19 13:45 ` Simon Horman
2025-06-19 22:52 ` Jakub Kicinski
2025-06-20  8:14   ` Nicolas Dichtel
2025-06-21 13:54     ` Jakub Kicinski [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=20250621065439.0fd2b6f6@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=pabeni@redhat.com \
    /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.