public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>
Cc: Jon Maloy <jmaloy@redhat.com>, passt-dev@passt.top
Subject: Re: [PATCH v7 01/13] dhcpv6: Fix reply destination to match client's source address
Date: Mon, 22 Jun 2026 13:39:01 +1000	[thread overview]
Message-ID: <ajiuVSp0XFyFvAqD@zatzit> (raw)
In-Reply-To: <20260620001142.0d838714@elisabeth>

[-- Attachment #1: Type: text/plain, Size: 2856 bytes --]

On Sat, Jun 20, 2026 at 12:11:42AM +0200, Stefano Brivio wrote:
> On Thu, 14 May 2026 15:21:57 +1000
> David Gibson <david@gibson.dropbear.id.au> wrote:
> 
> > On Sun, Apr 12, 2026 at 08:53:07PM -0400, Jon Maloy wrote:
> > > tap_ip6_daddr() selects the reply destination based on our source
> > > address type (link-local), so it always returns addr_ll_seen.  
> > 
> > I think there might have been more callers of tap_ip6_daddr() in the
> > past, which might have made this not true.
> > 
> > > But if
> > > the client sent from a global address, we would reply to an address
> > > different from what the client is expecting. Since RFC 8415 allows
> > > clients to use global addresses for DHCPv6, we now correct this, and
> > > always respond to the address the client was using.  
> > 
> > Responding to the same address the client used is a good idea in
> > general.  However, for this specific case, I don't think it will quite
> > do what we want.  The problem is that we're still always using
> > our_tap_ll (link local) as the source address.  So if the client used
> > a global address we'll send a packet with mismatched address scopes.
> > AFAIU that won't usually work.
> 
> At least for TCP on Linux that actually works. I haven't tried
> DHCPv6.

Yeah.. I haven't really managed to get my head around what works and
what doesn't when mixing scopes.  It seems unsafe to send from a
link-local to a global address unless you know the owner of that
global address is on the same link as you.  Linux will (at least
sometimes) know this from the routing table, but of course such a
packet could never be routed.

A similar rule applies in theory for site-local => global, except that
the sending host has no obvious way of knowing if the destination
address is at the same site.  This may well be one of the reasons that
site-local unicast was deprecated.

In the other direction, I guess you can accept packets that come from
a global address to a *-local address - and even reply to them - on
the grounds that they couldn't have reached you if the peer wasn't in
the same link/site/whatever.

I suppose, then, you could make the argument that actually you *can*
send from a *-local address to a global address on the grounds that if
it's not on the same link, an intervening router will either drop it
or NAT it for you.  I think that seems to be the assumption used for
IPv4 link-local addresses, at least; or they'd be near useless.

> Regardless of that, indeed, it doesn't look like a good idea, and we
> shouldn't start doing that if we weren't doing it before.
> 
> -- 
> Stefano
> 

-- 
David Gibson (he or they)	| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you, not the other way
				| around.
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2026-06-22  3:39 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-13  0:53 [PATCH v7 00/13] Introduce multiple addresses and late binding Jon Maloy
2026-04-13  0:53 ` [PATCH v7 01/13] dhcpv6: Fix reply destination to match client's source address Jon Maloy
2026-05-14  5:21   ` David Gibson
2026-06-19 22:11     ` Stefano Brivio
2026-06-22  3:39       ` David Gibson [this message]
2026-06-19 22:09   ` Stefano Brivio
2026-04-13  0:53 ` [PATCH v7 02/13] passt, pasta: Introduce unified multi-address data structures Jon Maloy
2026-05-14  6:30   ` David Gibson
2026-05-14 23:28     ` Stefano Brivio
2026-05-25  9:35       ` David Gibson
2026-06-19 22:09   ` Stefano Brivio
2026-06-22  1:39     ` David Gibson
2026-04-13  0:53 ` [PATCH v7 03/13] fwd: Unify guest accessibility checks with unified address array Jon Maloy
2026-05-25  9:38   ` David Gibson
2026-06-19 22:09   ` Stefano Brivio
2026-04-13  0:53 ` [PATCH v7 04/13] arp: Check all configured addresses in ARP filtering Jon Maloy
2026-06-19 22:10   ` Stefano Brivio
2026-04-13  0:53 ` [PATCH v7 05/13] conf: Allow multiple -a/--address options per address family Jon Maloy
2026-05-25  9:47   ` David Gibson
2026-06-19 22:10   ` Stefano Brivio
2026-04-13  0:53 ` [PATCH v7 06/13] netlink, conf: Read all addresses from template interface at startup Jon Maloy
2026-04-13  0:53 ` [PATCH v7 07/13] netlink, pasta: refactor function pasta_ns_conf() Jon Maloy
2026-05-26  1:58   ` David Gibson
2026-04-13  0:53 ` [PATCH v7 08/13] conf, pasta: Track observed guest IPv4 addresses in unified address array Jon Maloy
2026-05-27  2:46   ` David Gibson
2026-06-19 22:10   ` Stefano Brivio
2026-06-22  1:46     ` David Gibson
2026-04-13  0:53 ` [PATCH v7 09/13] conf, pasta: Track observed guest IPv6 " Jon Maloy
2026-05-27  3:40   ` David Gibson
2026-06-19 22:11     ` Stefano Brivio
2026-04-13  0:53 ` [PATCH v7 10/13] migrate: Update protocol to v3 for multi-address support Jon Maloy
2026-05-27  3:55   ` David Gibson
2026-06-19 22:11   ` Stefano Brivio
2026-04-13  0:53 ` [PATCH v7 11/13] dhcp: Select address for DHCP distribution Jon Maloy
2026-05-27  4:30   ` David Gibson
2026-06-19 22:11   ` Stefano Brivio
2026-04-13  0:53 ` [PATCH v7 12/13] dhcpv6: Select addresses for DHCPv6 distribution Jon Maloy
2026-05-27  4:40   ` David Gibson
2026-06-19 22:11   ` Stefano Brivio
2026-04-13  0:53 ` [PATCH v7 13/13] ndp: Support advertising multiple prefixes in Router Advertisements Jon Maloy
2026-05-27  4:52   ` David Gibson
2026-06-19 22:11   ` Stefano Brivio

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=ajiuVSp0XFyFvAqD@zatzit \
    --to=david@gibson.dropbear.id.au \
    --cc=jmaloy@redhat.com \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@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.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).