aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm53xx/base-files
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2017-01-31 13:53:46 +0100
committerRafał Miłecki <rafal@milecki.pl>2017-02-01 15:26:40 +0100
commit58221d79d9a6f938fd006eae2760f75f45a87a85 (patch)
tree0706d6476a21a9afc5ad2643a604f72b32159d9b /target/linux/bcm53xx/base-files
parentf204e0fc4619c7c64d0d99b87b0ddd802338d78a (diff)
downloadupstream-58221d79d9a6f938fd006eae2760f75f45a87a85.tar.gz
upstream-58221d79d9a6f938fd006eae2760f75f45a87a85.tar.bz2
upstream-58221d79d9a6f938fd006eae2760f75f45a87a85.zip
bcm53xx: fix LAN MAC address for devices that use eth2 originally
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 <rafal@milecki.pl>
Diffstat (limited to 'target/linux/bcm53xx/base-files')
-rwxr-xr-xtarget/linux/bcm53xx/base-files/etc/board.d/02_network6
1 files changed, 6 insertions, 0 deletions
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 672b1349df..0a055f4d1f 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
;;