mediatek: filogic: set eth0 and LAN port MACs on TP-Link BE450
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>
This commit is contained in:
@@ -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)"
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user