From efb05185ab14e0f1538c3f263b660f21a4a7b0a9 Mon Sep 17 00:00:00 2001 From: kysonlok Date: Mon, 12 Jun 2017 10:35:34 +0800 Subject: [PATCH] wan mac address consistant with lan --- patches/104-gl-mt300n-v2.patch | 11 +++++++++++ target/linux/ramips/base-files/etc/board.d/02_network | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/patches/104-gl-mt300n-v2.patch b/patches/104-gl-mt300n-v2.patch index 3a4c91d656..4c517ffb8b 100644 --- a/patches/104-gl-mt300n-v2.patch +++ b/patches/104-gl-mt300n-v2.patch @@ -23,6 +23,17 @@ awapn2403) ucidef_add_switch "switch0" \ "0:lan" "1:wan" "6@eth0" +@@ -425,6 +429,10 @@ ramips_setup_macs() + wan_mac="$(grep -m1 mac= "/dev/mtd${index}" | cut -d= -f2)" + lan_mac=$wan_mac + ;; ++ gl-mt300n-v2) ++ lan_mac=$(mtd_get_mac_binary factory 4) ++ wan_mac=$(mtd_get_mac_binary factory 4) ++ ;; + *) + lan_mac=$(cat /sys/class/net/eth0/address) + wan_mac=$(macaddr_add "$lan_mac" 1) --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -208,6 +208,9 @@ ramips_board_detect() { diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network index e3651a8650..984c25a19d 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -429,6 +429,10 @@ ramips_setup_macs() wan_mac="$(grep -m1 mac= "/dev/mtd${index}" | cut -d= -f2)" lan_mac=$wan_mac ;; + gl-mt300n-v2) + lan_mac=$(mtd_get_mac_binary factory 4) + wan_mac=$(mtd_get_mac_binary factory 4) + ;; *) lan_mac=$(cat /sys/class/net/eth0/address) wan_mac=$(macaddr_add "$lan_mac" 1)