From 9f75f7bf6c143ee3ba7522d281f3a930634cbd83 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Wed, 7 Oct 2026 19:57:00 +0200 Subject: interfaces: T3871: report a name which changed hands between known cards Cards rearranged among themselves, or a map edited by hand, leave every name matched to a card the store knows - just not the one it had. That was filed as an ordinary match, indistinguishable from a machine where nothing moved, while the addresses configured under those names had quietly changed cable. Report it separately. Which name goes to which card is unchanged, the slot still decides; only the account of what happened is. --- python/vyos/ifconfig/ifname_store.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'python') diff --git a/python/vyos/ifconfig/ifname_store.py b/python/vyos/ifconfig/ifname_store.py index 5f25235ae..d30d39a7f 100644 --- a/python/vyos/ifconfig/ifname_store.py +++ b/python/vyos/ifconfig/ifname_store.py @@ -357,7 +357,8 @@ def resolve(devices: list, store: dict) -> tuple: seen = {n: m for n, m in seen.items() if n not in misfiled} assigned = {} # final name -> device - report = {'matched': {}, 'moved': {}, 'replaced': {}, 'bootstrapped': {}} + report = {'matched': {}, 'reassigned': {}, 'moved': {}, + 'replaced': {}, 'bootstrapped': {}} # A recorded name stays off-limits even while its slot is empty, so new # hardware cannot inherit an absent interface's name and configuration. @@ -382,7 +383,8 @@ def resolve(devices: list, store: dict) -> tuple: # a card the store already knows about, sitting in this name's slot. The # cards were rearranged among themselves, or the map was edited by hand - # either way the map is what decides names, so the slot wins and the - # address on record simply follows. + # address on record simply follows. The name changes hands, so it is + # reported apart from a card which simply stayed where it was. known = {mac for mac in seen.values() if mac} for name, key in entries.items(): if name in assigned: @@ -390,7 +392,7 @@ def resolve(devices: list, store: dict) -> tuple: for device in remaining: if (device_matches(device['properties'], key) and device['mac'] in known): - claim(device, name, 'matched') + claim(device, name, 'reassigned') break # the card moved, and nothing the store knows took its place. Its address -- cgit v1.2.3