[source] ipq806x: nbg6817: sync MAC addresses to the upstream values
LEDE Commits
lede-commits at lists.infradead.org
Fri Nov 3 15:05:24 PDT 2017
mkresin pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/bdf19eec356a8f53c3ddd9785c99d7029a38b4b1
commit bdf19eec356a8f53c3ddd9785c99d7029a38b4b1
Author: Stefan Lippers-Hollmann <s.l-h at gmx.de>
AuthorDate: Mon Oct 30 04:28:34 2017 +0100
ipq806x: nbg6817: sync MAC addresses to the upstream values
The ZyXEL NBG6817 calculates all MAC addresses based on the ethaddr
value stored in the U-Boot environment (0:APPSBLENV). No MAC addresses
are stored in the ART partition and the generated MAC addresses for the
wlan interfaces alternate randomly between 12:34:56:78:90:12 and
00:03:7f:12:34:56.
interface new/ OEM MAC old MAC
wlan-2.4g (phy1): ethaddr undefined
wlan-5g (phy0): ethaddr + 1 undefined
lan : ethaddr + 2 ethaddr
wan : ethaddr + 3 ethaddr + 1
This patch defines stable MAC addresses for the wlan interfaces for
the first time instead of generating them at random. The previously
defined values for lan/ wan are changed to follow the settings of the
OEM firmware.
Signed-off-by: Stefan Lippers-Hollmann <s.l-h at gmx.de>
---
target/linux/ipq806x/base-files/etc/board.d/02_network | 4 ++--
.../linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac | 3 +++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network
index f13d1e3..3162254 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/02_network
+++ b/target/linux/ipq806x/base-files/etc/board.d/02_network
@@ -43,8 +43,8 @@ nbg6817)
hw_mac_addr=$(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "6 at eth1" "5:wan" "0 at eth0"
- ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
- ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 1)"
+ ucidef_set_interface_macaddr "lan" "$(macaddr_add $hw_mac_addr 2)"
+ ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 3)"
;;
*)
echo "Unsupported hardware. Network interfaces not intialized"
diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index 2ea408d..9ebd8ed 100644
--- a/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ b/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -23,6 +23,9 @@ case "$board" in
ea8500)
echo $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) $(($PHYNBR + 1)) ) > /sys${DEVPATH}/macaddress
;;
+ nbg6817)
+ echo $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) $((1 - $PHYNBR)) ) > /sys${DEVPATH}/macaddress
+ ;;
vr2600v)
echo $(macaddr_add $(mtd_get_mac_binary default-mac 0) $(($PHYNBR - 1)) ) > /sys${DEVPATH}/macaddress
;;
More information about the lede-commits
mailing list