From 3f7776a260a6c72832e3413eb3339f4c6f02b00b Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 29 Sep 2025 18:30:12 +0200 Subject: [PATCH] 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 Link: https://github.com/openwrt/openwrt/pull/20241 Signed-off-by: Hauke Mehrtens --- 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 } -- 2.30.2