Skip to content

Commit a1360d6

Browse files
committed
T8329: Skip enslaved interfaces to be considered as independent physical interfaces during hw-id naming
These interfaces include the Azure VF interfaces which share the same mac address with their master synthetic interface
1 parent 44703a8 commit a1360d6

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/system/vyos-net-name-resolve.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ def discover_physical_interfaces(sys_class_net: str = '/sys/class/net') -> dict:
178178
"""Return {kernel_name: mac} for every interface backed by a real bus
179179
device - excludes lo, bridges, bonds, VLANs, veth, tunnels, etc.
180180
181+
Also excludes interfaces enslaved to another netdev (master symlink
182+
present), which covers Azure VF datapath interfaces bound under their
183+
synthetic parent. Those are acceleration children, not independent
184+
primary interfaces, and must not be candidates for hw-id naming.
185+
181186
sys_class_net is overridable for testing against a fake sysfs tree.
182187
"""
183188
interfaces = {}
@@ -187,6 +192,14 @@ def discover_physical_interfaces(sys_class_net: str = '/sys/class/net') -> dict:
187192

188193
for entry in net_dir.iterdir():
189194
if not (entry / 'device').exists():
195+
logger.debug(
196+
f"skipping '{entry.name}': no backing device in sysfs"
197+
)
198+
continue
199+
if (entry / 'master').exists():
200+
logger.debug(
201+
f"skipping '{entry.name}': interface is enslaved via master link"
202+
)
190203
continue
191204
mac = get_permanent_mac(entry.name, sys_class_net)
192205
if mac:

0 commit comments

Comments
 (0)