summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-10-07 19:56:54 +0200
committerChristian Breunig <christian@breunig.cc>2026-10-31 09:58:29 +0000
commit5d63400b3d5e7a95014577fdb3b18a78ac57cafe (patch)
treeaeddf9363bc1278c37bb2e1799de881c015331b4 /python
parent32f664077d1012c42e0544ccb5a4e1456f783998 (diff)
downloadvyos-1x-5d63400b3d5e7a95014577fdb3b18a78ac57cafe.tar.gz
vyos-1x-5d63400b3d5e7a95014577fdb3b18a78ac57cafe.zip
interfaces: T3871: leave wireless names to the configuration
Every interface created on a radio carries that phy's address, so they are indistinguishable here. A name recorded against one of them was applied to whichever appeared next: configuring a second interface on a phy renamed it on top of the first, and the smoketests lost the interface they had just asked for. Nothing anchors a radio, and nothing needs to - wireless names come from 'physical-device'. Stop discovering them, stop writing a .link for them, and drop what an earlier version recorded so the entry and its file go on upgrade.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig/ifname_store.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/python/vyos/ifconfig/ifname_store.py b/python/vyos/ifconfig/ifname_store.py
index f2131a55a..2145b8ce0 100644
--- a/python/vyos/ifconfig/ifname_store.py
+++ b/python/vyos/ifconfig/ifname_store.py
@@ -150,6 +150,13 @@ def discover_devices(sys_class_net: str = '/sys/class/net') -> list:
Skips virtual interfaces, enslaved ones, SR-IOV virtual functions and
hypervisor VF datapaths - the latter share another interface's MAC.
+
+ Wireless is skipped too, and not because it is uninteresting: a radio's
+ interfaces are created from the configuration on a given phy, and every
+ one of them carries that phy's address. They are indistinguishable here,
+ so a name recorded against one would be applied to whichever appeared
+ next - renaming an interface the operator had just asked for by name.
+ Wireless names come from the configuration; nothing to anchor.
"""
devices = []
net_dir = Path(sys_class_net)
@@ -165,6 +172,8 @@ def discover_devices(sys_class_net: str = '/sys/class/net') -> list:
continue
if entry.name.startswith('vf_'):
continue
+ if is_wireless(entry.name, sys_class_net):
+ continue
mac = permanent_mac(entry.name, sys_class_net)
if not mac:
@@ -204,7 +213,8 @@ def load_store(path: Path = None) -> dict:
return empty_store()
interfaces = {name: key for name, key in data['interfaces'].items()
- if isinstance(key, str) and key}
+ if isinstance(key, str) and key
+ and not name.startswith('wlan')}
# the card each name last sat on. Absent from a store written before this
# was recorded, which just means the first pass has nothing to compare
@@ -431,7 +441,10 @@ def sync_link_files(store: dict, link_dir: Path = None) -> list:
written = {}
for name, key in store.get('interfaces', {}).items():
- if key:
+ # never for a radio: the key is the phy's address, which every
+ # interface created on that phy shares, so the file would rename
+ # whichever of them udev saw next
+ if key and not name.startswith('wlan'):
written[link_dir / f'{LINK_PREFIX}{name}.link'] = render_link(name, key)
for path, body in written.items():