From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linode.cmadams.net (linode.cmadams.net [45.33.75.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C2303E00A9 for ; Fri, 29 May 2026 12:06:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.33.75.86 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780056414; cv=none; b=Q1VMQIanTSpAjB3FGPO784il5nIOl6kKMYocsWg4n1NdDcNGe7vFzp5oy5lWkQUVUcnmDayqq/zgHiWgUolrcJX7xpfKXyAXIvmwKcZTorUoXUndQ/7FY2bQtBCEli2V4rjQwgymlXWn8gV6OFU8xTmm/bhpjhMOatORmvjRjVQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780056414; c=relaxed/simple; bh=CmfOf/VzsMeNZaPI94AnLpxctRBbBpTYldeoUfxWmnk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YT3/RMl+tDkd3Rd++RP506vEbltMn7etHJiuxOTQOKEslCRG7Ay+hWw+FUAwXSEti4PxkdQfGo87O7n16lbCg+9qn/FXM1wKwdb1Iyab2GVTdq0FIK5HduGqZ4p1juYHnWAjIS7B/wZj2mKvxH39gzQsQNb4vcmB2trkx4PEEQ4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmadams.net; spf=pass smtp.mailfrom=cmadams.net; dkim=pass (2048-bit key) header.d=cmadams.net header.i=@cmadams.net header.b=nUJ/3ULj; arc=none smtp.client-ip=45.33.75.86 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmadams.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmadams.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cmadams.net header.i=@cmadams.net header.b="nUJ/3ULj" Received: from localhost (localhost [127.0.0.1]) by linode.cmadams.net (Postfix) with ESMTP id 4gRhsw0VDGz6wQT; Fri, 29 May 2026 07:06:44 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cmadams.net; h= user-agent:in-reply-to:content-disposition:content-type :content-type:mime-version:references:message-id:subject:subject :from:from:date:date:received:received; s=20220404; t= 1780056403; x=1780920404; bh=CmfOf/VzsMeNZaPI94AnLpxctRBbBpTYlde oUfxWmnk=; b=nUJ/3ULjmrq1DiZLnMBrTRAbNcE+20UU3sDvtJ3MwSEu22MTjLQ CcumXsv0c5/Kb8wjzoZgbDTN5iN9xvR45g3IxkY40WRulQrsgEIpB6H+HyqIblaN mnjy5Wjj7ZiVG9nkuPwJ3KiWnR99V1KkCBWCyGCeslc1R+nLK/lFJrBT7zaHrPjJ gKiB0rq9dLaFnwQN6rigQBC7eDE6M7j//nHmkpRMJ6I56ZkMBYxF6DOP6v8yp0C6 lUgRVAAh5lao7C6tBEMc23gj7Gi8XclzEk3BBNYUhPwBqLdOfrxjUcxFkWh2a8Iu EWk6xK8bxjapqdHkSwyxnhkXVDn4vpuDyNQ== X-Virus-Scanned: amavisd-new at cmadams.net Received: from linode.cmadams.net ([127.0.0.1]) by localhost (linode.cmadams.net [127.0.0.1]) (amavisd-new, port 10031) with ESMTP id uZ8WMMUZnTBK; Fri, 29 May 2026 07:06:43 -0500 (CDT) Received: from cmadams.net (localhost [127.0.0.1]) by linode.cmadams.net (Postfix) with ESMTP id 4gRhss586Kz6tx7; Fri, 29 May 2026 07:06:41 -0500 (CDT) Date: Fri, 29 May 2026 07:06:41 -0500 From: Chris Adams To: Stefano Brivio Cc: Fernando Fernandez Mancera , netdev@vger.kernel.org, yuhuang@redhat.com, justin.iurman@gmail.com, horms@kernel.org, pabeni@redhat.com, kuba@kernel.org, edumazet@google.com, davem@davemloft.net, idosch@nvidia.com, dsahern@kernel.org, David Gibson , Beniamino Galvani , Thorsten Leemhuis , Andrew Lunn , ihuguet@redhat.com, regressions@lists.linux.dev Subject: Re: [PATCH net v2] Revert "ipv6: preserve insertion order for same-scope addresses" Message-ID: <20260529120641.GA19331@cmadams.net> Mail-Followup-To: Stefano Brivio , Fernando Fernandez Mancera , netdev@vger.kernel.org, yuhuang@redhat.com, justin.iurman@gmail.com, horms@kernel.org, pabeni@redhat.com, kuba@kernel.org, edumazet@google.com, davem@davemloft.net, idosch@nvidia.com, dsahern@kernel.org, David Gibson , Beniamino Galvani , Thorsten Leemhuis , Andrew Lunn , ihuguet@redhat.com, regressions@lists.linux.dev References: <20260529112357.5079-1-fmancera@suse.de> <20260529134045.56330243@elisabeth> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260529134045.56330243@elisabeth> User-Agent: Mutt/1.5.21 (2010-09-15) Once upon a time, Stefano Brivio said: > On Fri, 29 May 2026 13:23:57 +0200 > Fernando Fernandez Mancera wrote: > > > Chris Adams reported that preserving insertion order for same-scope > > addresses is causing SSH connections to be dropped after stopping a VM > > while running NetworkManager. > > > > NetworkManager caches the IPv6 address configuration, when a RA arrives, > > it determines the list of addresses to configure and checks if the > > addresses are already in the right order in the kernel. If they aren't, > > NetworkManager removes and re-adds them to achieve the desired order. > > > > As the order changes, NetworkManager is confused and reconfigures the > > addresses on every update. In addition, this would also affect to cloud > > tooling that relies on IPv6 addresses order to identify primary and > > secondaries addresses. > > By the way, I'm still looking into this part, trying to find > "problematic" examples. > > And I couldn't find any, yet, because it looks like there's always a > _single_ IPv6 address being used as a secondary for a primary IPv4 > address. I hit two cases that triggered the behavior: - after an overnight suspend/resume cycle (not sure if there's a minimum time suspended) - with a bridge NIC, after stopping a VM with a NIC on the bridge (which removed an fe80:: link-local address); this is the case I used to bisect since it was easy to script In both cases, the next IPv6 router-advertisement received was what triggered NetworkManager to replace the current privacy addresses. This could be 2-3 minutes after the trigger. > > This reverts commit cb3de96eea66f5e4a580086c6a1be46e765f97f4. > > > > Fixes: cb3de96eea66 ("ipv6: preserve insertion order for same-scope addresses") > > Reported-by: Chris Adams > > Closes: https://lore.kernel.org/netdev/20260521135310.GC977@cmadams.net/ > > Signed-off-by: Fernando Fernandez Mancera > > --- > > v2: updated commit description to make it more accurate > > --- > > net/ipv6/addrconf.c | 2 +- > > tools/testing/selftests/net/ioam6.sh | 2 +- > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c > > index 5476b6536eb7..bb84a78b80f6 100644 > > --- a/net/ipv6/addrconf.c > > +++ b/net/ipv6/addrconf.c > > @@ -1013,7 +1013,7 @@ ipv6_link_dev_addr(struct inet6_dev *idev, struct inet6_ifaddr *ifp) > > list_for_each(p, &idev->addr_list) { > > struct inet6_ifaddr *ifa > > = list_entry(p, struct inet6_ifaddr, if_list); > > - if (ifp_scope > ipv6_addr_src_scope(&ifa->addr)) > > + if (ifp_scope >= ipv6_addr_src_scope(&ifa->addr)) > > break; > > } > > > > diff --git a/tools/testing/selftests/net/ioam6.sh b/tools/testing/selftests/net/ioam6.sh > > index b2b99889942f..845c26dd01a9 100755 > > --- a/tools/testing/selftests/net/ioam6.sh > > +++ b/tools/testing/selftests/net/ioam6.sh > > @@ -273,8 +273,8 @@ setup() > > ip -netns $ioam_node_beta link set ioam-veth-betaR name veth1 &>/dev/null > > ip -netns $ioam_node_gamma link set ioam-veth-gamma name veth0 &>/dev/null > > > > - ip -netns $ioam_node_alpha addr add 2001:db8:1::2/64 dev veth0 &>/dev/null > > ip -netns $ioam_node_alpha addr add 2001:db8:1::50/64 dev veth0 &>/dev/null > > + ip -netns $ioam_node_alpha addr add 2001:db8:1::2/64 dev veth0 &>/dev/null > > ip -netns $ioam_node_alpha link set veth0 up &>/dev/null > > ip -netns $ioam_node_alpha link set lo up &>/dev/null > > ip -netns $ioam_node_alpha route add 2001:db8:2::/64 \ > > -- > Stefano -- Chris Adams