From f5c844e8a6c2238555b8e519fe929a64e56b3388 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Wed, 7 Oct 2026 19:56:51 +0200 Subject: interfaces: T3871: warn about a replaced card when it is swapped, not only at boot A card which takes over a slot also takes over the addresses configured under that name. The boot script says so by reading the status file, but a card swapped on a running system is only ever seen by the naming pass itself, and by the next boot it is already on record with nothing left to report. The warning could therefore never reach an operator who replaced a card without rebooting. Log it where the decision is taken, which covers both. --- src/system/vyos-net-name-resolve.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/system') diff --git a/src/system/vyos-net-name-resolve.py b/src/system/vyos-net-name-resolve.py index df1f10f72..aa0e74c74 100755 --- a/src/system/vyos-net-name-resolve.py +++ b/src/system/vyos-net-name-resolve.py @@ -198,6 +198,15 @@ def main(): for name, mac in sorted(report.get('bootstrapped', {}).items()): logger.info(f"new hardware {mac} named '{name}'") + + # A card which took over a slot also took over the addresses configured + # under that name. vyos-router says so for a boot, but a card swapped on + # a running system is only ever seen here. + for name, mac in sorted(report.get('replaced', {}).items()): + logger.warning( + f"'{name}' was matched to new hardware {mac} by slot - verify it " + 'is the port you expect before relying on its configuration' + ) applied = safe_bulk_rename(plan) persisted = save_store(store) -- cgit v1.2.3