summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-10-07 19:56:58 +0200
committerChristian Breunig <christian@breunig.cc>2026-10-31 09:58:29 +0000
commitccac4ac565796934fa217dbcb6f470819ffb2d36 (patch)
tree2e3cd76648314af2905d97ad08e02d0f92fcde1c /python
parent9d44e93638ccc189c99305b2b423222b2dab2b9c (diff)
downloadvyos-1x-ccac4ac565796934fa217dbcb6f470819ffb2d36.tar.gz
vyos-1x-ccac4ac565796934fa217dbcb6f470819ffb2d36.zip
interfaces: T3871: keep bridge and bond members discoverable
An interface was passed over as soon as it had a master, which covers a VF datapath but also every bridge, bond and VRF member. Those are still their own card in their own slot, so the naming pass reported them as hardware which had not appeared, on any run made while they were in use. Skip only when the master is a device itself. That is what tells the accelerated path, which belongs to the interface it is enslaved to, apart from a member, which does not.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig/ifname_store.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/python/vyos/ifconfig/ifname_store.py b/python/vyos/ifconfig/ifname_store.py
index eadd3994e..5f25235ae 100644
--- a/python/vyos/ifconfig/ifname_store.py
+++ b/python/vyos/ifconfig/ifname_store.py
@@ -160,8 +160,8 @@ def read_properties(ifname: str) -> dict:
def discover_devices(sys_class_net: str = '/sys/class/net') -> list:
"""Every interface backed by independently-addressable hardware.
- Skips virtual interfaces, enslaved ones, SR-IOV virtual functions and
- hypervisor VF datapaths - the latter share another interface's MAC.
+ Skips virtual interfaces, 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
@@ -178,7 +178,11 @@ def discover_devices(sys_class_net: str = '/sys/class/net') -> list:
for entry in sorted(net_dir.iterdir()):
if not (entry / 'device').exists():
continue
- if (entry / 'master').exists():
+ # a VF datapath is enslaved to the interface it accelerates, which is
+ # a device in its own right. A bridge, bond or VRF is not, and its
+ # members stay real hardware while they are in it.
+ master = entry / 'master'
+ if master.exists() and (master / 'device').exists():
continue
if (entry / 'device' / 'physfn').exists():
continue