From 2b6a744cc2f90114fa0df85db096495866a403e2 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Wed, 7 Oct 2026 19:57:05 +0200 Subject: ethernet: T3871: restore the address the card came with, not the one on it Deleting an ethernet configuration puts the hardware address back. It was read from the driver, which reports the current address when it cannot report a permanent one separately - and at that point the current address is still the custom one being removed, so it was reapplied rather than undone and the card kept an address the configuration no longer mentioned. Ask what naming recorded for the interface first, as the reset path already does. That was taken before any custom address was applied, and the driver stays the fallback for an interface no pass has seen. --- python/vyos/ifconfig/ethernet.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'python') diff --git a/python/vyos/ifconfig/ethernet.py b/python/vyos/ifconfig/ethernet.py index 2f53b5e06..60a3ce7a3 100644 --- a/python/vyos/ifconfig/ethernet.py +++ b/python/vyos/ifconfig/ethernet.py @@ -20,6 +20,7 @@ from glob import glob from vyos.base import Warning from vyos.ethtool import Ethtool from vyos.ifconfig.ifname_store import permanent_mac +from vyos.ifconfig.ifname_store import recorded_mac from vyos.ifconfig.interface import Interface from vyos.utils.dict import dict_search from vyos.utils.file import read_file @@ -162,7 +163,10 @@ class EthernetIf(Interface): # of step with the bond it is still in. Releasing it runs this again. tmp = get_interface_config(self.ifname) if dict_search('linkinfo.info_slave_kind', tmp) != 'bond': - mac = permanent_mac(self.ifname) + # what naming recorded first: a driver which cannot report a + # permanent address reports the current one instead, which is the + # custom address still on the port at this point + mac = recorded_mac(self.ifname) or permanent_mac(self.ifname) if mac: self.set_mac(mac) -- cgit v1.2.3