Commit 072aa0f5 authored by Fernando Fernandez Mancera's avatar Fernando Fernandez Mancera Committed by Jakub Kicinski
Browse files

Revert "ipv6: preserve insertion order for same-scope addresses"



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.

This reverts commit cb3de96e.

Fixes: cb3de96e ("ipv6: preserve insertion order for same-scope addresses")
Reported-by: default avatarChris Adams <linux@cmadams.net>
Closes: https://lore.kernel.org/netdev/20260521135310.GC977@cmadams.net/


Signed-off-by: default avatarFernando Fernandez Mancera <fmancera@suse.de>
Link: https://patch.msgid.link/20260529112357.5079-1-fmancera@suse.de


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent c84ff04d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
	}

+1 −1
Original line number Diff line number Diff line
@@ -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 \