diff --git a/target/linux/ath79/nand/base-files/etc/board.d/02_network b/target/linux/ath79/nand/base-files/etc/board.d/02_network index 1626ec31cac..b2191eed92f 100755 --- a/target/linux/ath79/nand/base-files/etc/board.d/02_network +++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network @@ -48,10 +48,6 @@ ath79_setup_macs() netgear,wndr4500-v3) wan_mac=$(mtd_get_mac_binary caldata 0x6) ;; - zyxel,nbg6716) - lan_mac=$(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +2) - wan_mac=$(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +3) - ;; esac [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac diff --git a/target/linux/ath79/nand/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/ath79/nand/base-files/lib/preinit/10_fix_eth_mac.sh new file mode 100644 index 00000000000..fdd8381f562 --- /dev/null +++ b/target/linux/ath79/nand/base-files/lib/preinit/10_fix_eth_mac.sh @@ -0,0 +1,14 @@ +. /lib/functions.sh +. /lib/functions/system.sh + +preinit_set_mac_address() { + case $(board_name) in + zyxel,nbg6716) + ethaddr=$(mtd_get_mac_ascii u-boot-env ethaddr) + ip link set dev eth0 address $(macaddr_add $ethaddr 2) + ip link set dev eth1 address $(macaddr_add $ethaddr 3) + ;; + esac +} + +boot_hook_add preinit_main preinit_set_mac_address