]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: Skip auto-MAC assignment for devices with MACs in DT 20241/head
authorSven Eckelmann <se@simonwunderlich.de>
Mon, 29 Sep 2025 16:30:12 +0000 (18:30 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 12 Oct 2025 13:52:13 +0000 (15:52 +0200)
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>
target/linux/realtek/base-files/etc/board.d/02_network

index 464ff976cfa29b87ec065cb46b9ee4f33c54afaf..b8e588f2865483b0b9b544b35dafdbe2865f6bed 100644 (file)
@@ -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
 }