[OpenWrt-Devel] [PATCH] ramips: fix LAN/WAN MAC addresses of Xiaomi MiWiFi Mini board

Adrian Schmutzler freifunk at adrianschmutzler.de
Mon Oct 21 09:40:32 EDT 2019

Based on stock firmware tests, both LAN and WAN ports use the
MAC address from 0x28 on factory partition.

In OpenWrt, this one is already set in DTS. This patch removes the
local bit set in 02_network previously, and adjusts LAN/WAN
addresses as on stock firmware.

Note that in tests we found a MAC address in 0x2e that is the one
in 0x28 plus 1. Since stock firmware does not use it though, we
do not use it either.

Thanks to Chih-Wei Chen for testing this on his device.

ref: https://github.com/openwrt/openwrt/pull/2497

Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
 target/linux/ramips/base-files/etc/board.d/02_network | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

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 ded416ae98..b6c3ae42cb 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -587,6 +587,7 @@ ramips_setup_macs()
+	xiaomi,miwifi-mini|\
 		# This empty case has to be kept for devices without any MAC address adjustments
@@ -721,9 +722,6 @@ ramips_setup_macs()
 		lan_mac=$(mtd_get_mac_binary factory 0xe006)
-	xiaomi,miwifi-mini)
-		lan_mac=$(macaddr_setbit_la "$(cat /sys/class/net/eth0/address)")
-		;;
 		wan_mac=$(mtd_get_mac_binary factory 0xe006)
 		label_mac=$(cat /sys/class/ieee80211/phy0/macaddress)

openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list