From d5b53395407ee43c80dbf0fb2a46567cba51033d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Tue, 31 Jan 2017 13:53:46 +0100 Subject: [PATCH] bcm53xx: fix LAN MAC address for devices that use eth2 originally MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We override default Ethernet interface with eth0 which often uses random MAC due to missing proper NVRAM entry. Fix this by manually assigning MAC in the config. Signed-off-by: Rafał Miłecki --- target/linux/bcm53xx/base-files/etc/board.d/02_network | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/linux/bcm53xx/base-files/etc/board.d/02_network b/target/linux/bcm53xx/base-files/etc/board.d/02_network index 672b1349dfb..0a055f4d1ff 100755 --- a/target/linux/bcm53xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm53xx/base-files/etc/board.d/02_network @@ -50,6 +50,12 @@ netgear,r8500) ifname=eth0 ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5t@$ifname" + + # These devices should use eth2 so their eth0 interface often has no MAC + # assigned. Manually assign eth2's MAC to the LAN. + et2macaddr="$(nvram get et2macaddr)" + [ -n "$et2macaddr" ] && ucidef_set_interface_macaddr "lan" "$et2macaddr" + board_config_flush exit 0 ;;