mediatek: fix xdr608x eth & wifi mac addr (#242)

set xdr608x’s eth & mac address same as stock firmware:
<lan_mac>=<label_mac>=<ra0_mac>
<wan_mac>=<lan_mac>+1
<rax0_mac>=<lan_mac>+2
This commit is contained in:
seckv 2024-02-01 21:01:21 +08:00 committed by GitHub
parent d3ab1bf5e6
commit 61c2cbe8ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -89,19 +89,20 @@ mediatek_setup_macs()
;;
tplink,tl-xdr6086|\
tplink,tl-xdr6088)
wan_mac=$(mtd_get_mac_binary config 0x1c)
lan_mac=$(macaddr_add "$wan_mac" 1)
local b0dat="$(l1dat if2dat ra0)"
local b1dat="$(l1dat if2dat rax0)"
if [ -f ${b0dat} ] && ! grep -q "MacAddress=" ${b0dat}; then
local b0mac="$(macaddr_add $label_mac 2)"
echo "MacAddress=$b0mac" >> ${b0dat}
fi
if [ -f ${b1dat} ] && ! grep -q "MacAddress=" ${b1dat}; then
local b1mac="$(macaddr_add $label_mac 3)"
echo "MacAddress=$b1mac" >> ${b1dat}
fi
;;
lan_mac=$(mtd_get_mac_binary config 0x1c)
wan_mac=$(macaddr_add "$lan_mac" 1)
label_mac=$lan_mac
local b0dat="$(l1dat if2dat ra0)"
local b1dat="$(l1dat if2dat rax0)"
if [ -f ${b0dat} ] && ! grep -q "MacAddress=" ${b0dat}; then
local b0mac="$label_mac"
echo "MacAddress=$b0mac" >> ${b0dat}
fi
if [ -f ${b1dat} ] && ! grep -q "MacAddress=" ${b1dat}; then
local b1mac="$(macaddr_add $label_mac 2)"
echo "MacAddress=$b1mac" >> ${b1dat}
fi
;;
xiaomi,redmi-router-ax6000*)
wan_mac=$(mtd_get_mac_ascii Bdata ethaddr_wan)
lan_mac=$(mtd_get_mac_ascii Bdata ethaddr)