]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
mediatek: filogic: set eth0 and LAN port MACs on TP-Link BE450
authorSemih Baskan <strst.gs@gmail.com>
Tue, 7 Jul 2026 09:41:51 +0000 (12:41 +0300)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Mon, 20 Jul 2026 18:28:34 +0000 (20:28 +0200)
eth0 (gmac0) is declared label-mac-device, but nothing assigns its MAC,
so it and the DSA lan ports come up with a random locally administered
address that changes every boot. Assign the base MAC from tp_data
default-mac to eth0 and the lan ports, as is already done for eth1 and
eth2.

Each lan port needs its own assignment: a DSA user port copies the
conduit's MAC once when it is created, at driver probe before preinit
runs, and ignores later changes to eth0.

Run-tested on a BE450 on 25.12.5, where the case is identical.
Two boots without the fix each came up with a different
random address; with the fix applied, eth0 and the lan ports get the
label MAC and keep it across reboots.

Signed-off-by: Semih Baskan <strst.gs@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24180
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh

index ead84eca2657769685e06f1e7a8a3cdf9e7280de..41bbfd8d19aff430a1ec5cdba24d989ee6c23eaf 100644 (file)
@@ -37,6 +37,10 @@ preinit_set_mac_address() {
                ;;
        tplink,be450)
                addr=$(get_mac_binary "/tmp/tp_data/default-mac" 0)
+               ip link set dev eth0 address "$addr"
+               ip link set dev lan1 address "$addr"
+               ip link set dev lan2 address "$addr"
+               ip link set dev lan3 address "$addr"
                ip link set dev eth1 address "$(macaddr_add $addr 1)"
                ip link set dev eth2 address "$(macaddr_add $addr 2)"
                ;;