[OpenWrt-Devel] [PATCH] ramips: extract default lan_mac from eth0

Roman Yeryomin leroi.lists at gmail.com
Sun Jul 13 11:38:26 EDT 2014


The default case of ramips_setup_macs() is useful when mtd-mac-address is defined in dts.
But lan_mac is not set by default, this results in lan and wan having the same mac.

Signed-off-by: Roman Yeryomin <roman at advem.lv>
---
 target/linux/ramips/base-files/etc/uci-defaults/02_network | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network b/target/linux/ramips/base-files/etc/uci-defaults/02_network
index a14acb6..3b0df72 100755
--- a/target/linux/ramips/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network
@@ -246,6 +246,7 @@ ramips_setup_macs()
 		;;
 
 	*)
+		lan_mac=$(cat /sys/class/net/eth0/address)
 		wan_mac=$(macaddr_add "$lan_mac" 1)
 		;;
 
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list