public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrea Mayer <andrea.mayer@uniroma2.it>
To: Justin Iurman <justin.iurman@6wind.com>,
	Nicolas Dichtel <nicolas.dichtel@6wind.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, dsahern@kernel.org,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	horms@kernel.org, justin.iurman@gmail.com,
	stefano.salsano@uniroma2.it, paolo.lungaroni@uniroma2.it,
	ahabdels@cisco.com, Andrea Mayer <andrea.mayer@uniroma2.it>
Subject: Re: [PATCH net-next v2] seg6: add per-route tunnel source address
Date: Sat, 14 Mar 2026 02:09:04 +0100	[thread overview]
Message-ID: <20260314020904.3ec2344109a66ee70b2ec1ac@uniroma2.it> (raw)
In-Reply-To: <CAOY2BqwgYYibttTCc15a2SD=4RHMj43F47Ev20_u-a-siPzuOg@mail.gmail.com>

Hi Justin, Nicolas,

First of all, thanks both for the discussion on the link-local addresses.

On Fri, 13 Mar 2026 14:06:26 +0000
Justin Iurman <justin.iurman@6wind.com> wrote:

> On Fri, Mar 13, 2026 at 10:59 AM Nicolas Dichtel
> <nicolas.dichtel@6wind.com> wrote:
> >
> > Le 13/03/2026 à 11:20, Justin Iurman a écrit :
> > > On Fri, Mar 13, 2026 at 9:47 AM Nicolas Dichtel
> > > <nicolas.dichtel@6wind.com> wrote:
> > >>
> > >> Le 13/03/2026 à 09:44, Justin Iurman a écrit :
> > >>> On Fri, Mar 13, 2026 at 2:02 AM Andrea Mayer <andrea.mayer@uniroma2.it> wrote:
> > >>>>
> > >>>> On Wed, 11 Mar 2026 16:28:45 +0100
> > >>>> Justin Iurman <justin.iurman@6wind.com> wrote:
> > >>
> > >
> > > [snip]
> > >
> > >>>> Whether to also reject link-local is debatable: ip6_forward() does
> > >>>> drop it, but is there a legitimate use case where a link-local tunnel
> > >>>> source would actually be needed?!
> > >>>> I'd argue we should reject link-local addresses as well.
> > >>>> For instance, using them as a tunnel source violates scope boundaries and
> > >>>> breaks ICMPv6 error reporting.
> > >>>
> > >>> IMHO, I also think we could reasonably forbid LLs.
> > >>
> > >> Why rejecting LL? It's legal to use LL as a source address of a tunnel (and
> > >> forwarding packets in this tunnel). Is this forbidden with srv6?
> > >
> > > Well, this is indeed legal (at least nothing prevents it), but they're
> > > not routable. So question is does it make sense at all? We're talking
> > > about two nodes on the same layer-2 link as the only valid use-case
> > > here. I'm not sure it makes sense, especially in the context of SRv6.
> > Yes, you're probably right. I'm usually uncomfortable with a configuration being
> > forbidden without any real problem/reason.
> 
> After consideration, it looks like ip6_forward() does filter LL source
> addresses (see [1]), so such packets are never forwarded and there is
> no violation of scope boundaries. I agree it makes little sense to
> allow LL source addresses in the context of SRv6, but Nicolas has a
> point too (i.e., it's not harmful, let's not restrict things
> unnecessarily). I guess both ways are fine, maybe others can shim in
> and share their opinions. For v3, I'll just keep it as is, we can
> still make a change later.
> 
>  [1] https://elixir.bootlin.com/linux/v6.19.7/source/net/ipv6/ip6_output.c#L643

Justin, the ip6_forward() check is exactly the drop behavior I was referring
to. My initial concern was architectural, since a router wouldn't forward a
packet with a LL source anyway.

Nicolas, you make a fair point: nothing explicitly forbids using it.
I initially raised the question just to be on the safe side from the very
beginning and figure out the best path forward.
While it is a niche scenario, there can indeed exist valid use cases
(e.g., a host doing SRv6 encap with a LL source, sending it to a
directly connected SRv6 router that simply applies a decap behavior).

Since it doesn't harm the kernel, I agree we shouldn't artificially
forbid it. Allowing LLs in v3 is fine by me. Let's also see if anyone
else on the list has further thoughts on this.



Justin, regarding the other questions from your previous email about
selftests:
 
On Fri, 13 Mar 2026 08:44:04 +0000
Justin Iurman <justin.iurman@6wind.com> wrote:

> On Fri, Mar 13, 2026 at 2:02 AM Andrea Mayer <andrea.mayer@uniroma2.it> wrote:
> >
> > On Wed, 11 Mar 2026 16:28:45 +0100
> > Justin Iurman <justin.iurman@6wind.com> wrote:
> >
> > > Add SEG6_IPTUNNEL_SRC in the uapi for users to configure a specific
> > > tunnel source address. Make seg6_iptunnel handle the new attribute
> > > correctly. It has priority over the configured per-netns tunnel
> > > source address, if any.
> > >
> > > Signed-off-by: Justin Iurman <justin.iurman@6wind.com>
> > > ---
> [snip]
> 
> I agree. The reason why I did not is simply that, IIRC, none of the
> srv6 selftests actually check the source address ("ip sr tunsrc set
> xxx" is not even used, and dynamic resolution is the default
> behavior). Note that the source address is specifically checked in
> ioam6 selftest though (packet capture + parsing), but srv6 selftests
> are not designed the same way. What I suggest is to not overcomplicate
> things and simply modify srv6_hencap_red_l3vpn_test.sh and
> srv6_hl2encap_red_l2vpn_test.sh to include a test that does encap with
> "tunsrc" (and we could also add the same with "ip sr tunsrc set xxx").
> It wouldn't check for a specific source address though, would just
> make sure connectivity doesn't break like for other tests. Also, the
> other question is should we duplicate all tests for those cases: with
> "ip sr tunsrc set xxx", and with "tunsrc". WDYT?

To answer your questions:

1) Just checking for connectivity might not be sufficient here. If an
   issue causes the kernel to fall back to the default interface IP, a
   simple ping would still succeed, giving us a false positive. To verify
   the actual outer source address without overcomplicating things, we
   could maybe use policy routing (ip -6 rule) or a simple ip6tables/nftables
   rule on the receiving netns to drop the probe (ping) packet if its source
   address doesn't match the expected tunsrc.
   This is just a suggestion, of course; if you want, we can sync offline
   on this to figure out the best way to handle the selftest.

2) I don't think we need to duplicate the tests right now. We can
   consider extending the per-route tunsrc selftest to also cover the
   per-netns tunsrc later, when we start working on that specific
   per-netns fix.

>
> [snip]
>
> I agree. We could synchronize offline to squash the same fix for ioam6_iptunnel.

Yes, for sure!

Thanks,
Andrea

      reply	other threads:[~2026-03-14  1:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-11 15:28 [PATCH net-next v2] seg6: add per-route tunnel source address Justin Iurman
2026-03-13  2:02 ` Andrea Mayer
2026-03-13  8:44   ` Justin Iurman
2026-03-13  9:47     ` Nicolas Dichtel
2026-03-13 10:20       ` Justin Iurman
2026-03-13 10:59         ` Nicolas Dichtel
2026-03-13 14:06           ` Justin Iurman
2026-03-14  1:09             ` Andrea Mayer [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=20260314020904.3ec2344109a66ee70b2ec1ac@uniroma2.it \
    --to=andrea.mayer@uniroma2.it \
    --cc=ahabdels@cisco.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=justin.iurman@6wind.com \
    --cc=justin.iurman@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=pabeni@redhat.com \
    --cc=paolo.lungaroni@uniroma2.it \
    --cc=stefano.salsano@uniroma2.it \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox