summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Eckelmann2025-09-29 16:30:12 +0000
committerHauke Mehrtens2025-10-12 13:52:13 +0000
commit3f7776a260a6c72832e3413eb3339f4c6f02b00b (patch)
tree412d080e0ad9f8810e509cde9e6a96a2dd40c971
parent18e1929401bed72a6e4f7b9b4ccee81cc67a47d6 (diff)
downloadopenwrt-3f7776a260a6c72832e3413eb3339f4c6f02b00b.tar.gz
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@simonwunderlich.de> Link: https://github.com/openwrt/openwrt/pull/20241 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--target/linux/realtek/base-files/etc/board.d/02_network7
1 files 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
}