[pve-devel] [PATCH pve-network 2/6] sdn: controller: fallback to interface mac if no master
Hannes Laimer
h.laimer at proxmox.com
Thu Jan 22 14:51:47 CET 2026
For IPv6 underlays, we can't directly use the IP for the router-id.
Therefore, `get_router_id` derives a unique ID from the last 4 bytes of
the interface MAC.
However, the current MAC retrieval logic only checks the master device.
This fails for standalone interfaces that do not have a master, such as
`dummy_` interfaces used for fabrics.
Update `read_iface_mac` to fall back to the interface's own address if
no master address is found.
Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
---
src/PVE/Network/SDN/Controllers/Plugin.pm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/PVE/Network/SDN/Controllers/Plugin.pm b/src/PVE/Network/SDN/Controllers/Plugin.pm
index d70e518..cab036a 100644
--- a/src/PVE/Network/SDN/Controllers/Plugin.pm
+++ b/src/PVE/Network/SDN/Controllers/Plugin.pm
@@ -105,7 +105,9 @@ sub on_update_hook {
sub read_iface_mac {
my ($iface) = @_;
- return PVE::Tools::file_read_firstline("/sys/class/net/$iface/master/address");
+ my $mac = PVE::Tools::file_read_firstline("/sys/class/net/$iface/master/address");
+ return $mac if $mac;
+ return PVE::Tools::file_read_firstline("/sys/class/net/$iface/address");
}
sub get_router_id {
--
2.47.3
More information about the pve-devel
mailing list