[openwrt/openwrt] realtek: Skip auto-MAC assignment for devices with MACs in DT
LEDE Commits
lede-commits at lists.infradead.org
Sun Oct 12 06:53:10 PDT 2025
hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/3f7776a260a6c72832e3413eb3339f4c6f02b00b
commit 3f7776a260a6c72832e3413eb3339f4c6f02b00b
Author: Sven Eckelmann <se at simonwunderlich.de>
AuthorDate: Mon Sep 29 18:30:12 2025 +0200
realtek: Skip auto-MAC assignment for devices with MACs in DT
If the devicetree contains the appropriate nodes to configure the MAC
addresses for each physical DSA port, then these MAC addresses must be used
in OpenWrt and not some automatically generated ones. Otherwise the device
often ends up with addresses which are locally administered and not
matching any expected port-to-MAC scheme.
Devices which only get the MAC address for eth0 must still auto-generate
these MAC addresses until the devicetree was updated to also include the
correct ones.
Signed-off-by: Sven Eckelmann <se at simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20241
Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
target/linux/realtek/base-files/etc/board.d/02_network | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/target/linux/realtek/base-files/etc/board.d/02_network b/target/linux/realtek/base-files/etc/board.d/02_network
index 464ff976cf..b8e588f286 100644
--- a/target/linux/realtek/base-files/etc/board.d/02_network
+++ b/target/linux/realtek/base-files/etc/board.d/02_network
@@ -70,7 +70,10 @@ realtek_setup_macs()
plasmacloud,esx28|\
plasmacloud,psx8|\
plasmacloud,psx10|\
- plasmacloud,psx28|\
+ plasmacloud,psx28)
+ lan_mac_start=skip
+ lan_mac="$(get_mac_label)"
+ ;;
tplink,sg2008p-v1|\
tplink,sg2210p-v3|\
tplink,sg2452p-v4|\
@@ -102,7 +105,7 @@ realtek_setup_macs()
[ -n "$lan_mac" ] && ucidef_set_network_device_mac eth0 $lan_mac
[ -z "$lan_mac_start" -a -n "$lan_mac" ] && lan_mac_start=$lan_mac
- realtek_setup_macs_lan "$lan_list" "$lan_mac_start" "$lan_mac_end"
+ [ "$lan_mac_start" != "skip" ] && realtek_setup_macs_lan "$lan_list" "$lan_mac_start" "$lan_mac_end"
[ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac
}
More information about the lede-commits
mailing list