aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
diff options
context:
space:
mode:
authorMikhail Zhilkin <csharper2005@gmail.com>2022-07-09 17:09:57 +0000
committerChristian Marangi <ansuelsmth@gmail.com>2022-08-19 14:44:44 +0200
commitecd8f7e294a73d56906f7edcd8206ac6e304875c (patch)
treec01b910d52c15253f49fc7cc94e8a608fee8cd53 /target/linux/ramips/mt7621/base-files/etc/board.d/02_network
parent290ace2fe6ffbbf22c841e10d79267871f4d5748 (diff)
downloadupstream-ecd8f7e294a73d56906f7edcd8206ac6e304875c.tar.gz
upstream-ecd8f7e294a73d56906f7edcd8206ac6e304875c.tar.bz2
upstream-ecd8f7e294a73d56906f7edcd8206ac6e304875c.zip
ramips: get MAC addr from the encrypted partition (WG4хх223)
This commit resolves #10062. Adds decryption of the Arcadyan WG4xx223 configuration partition (board_data)to get base MAC address from it. As a result, after this change the hack with saving MAC addressees to u-boot-env before installation of OpenWrt is no longer necessary. This is necessary for the following devices: - Beeline Smartbox Flash (Arcadyan WG443223) - MTS WG430223 (Arcadyan WG430223) Example: +----------------+-------------------+------------------------+ | | MTS WG430223 | Beeline Smartbox Flash | +----------------+-------------------+------------------------+ | base mac (mtd) | A4:xx:xx:51:xx:F4 | 30:xx:xx:51:xx:06 | | label | A4:xx:xx:51:xx:F4 | 30:xx:xx:51:xx:09 | | LAN | A4:xx:xx:51:xx:F6 | 30:xx:xx:51:xx:09 | | WAN | A4:xx:xx:51:xx:F4 | 30:xx:xx:51:xx:06 | | WLAN_2g | A4:xx:xx:51:xx:F5 | 30:xx:xx:51:xx:07 | | WLAN_5g | A6:xx:xx:21:xx:F5 | 32:xx:xx:41:xx:07 | +----------------+-------------------+------------------------+ Collected statistic shows that the 2-4th bits of the 7th byte of the WLAN_5g MAC are the constant (see #10062 for more details): - Beeline Smartbox Flash - 100 - MTS WG430223 - 010 Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com> (cherry picked from commit a6b0d0806055a53a2538df83f8322c38ee9f3441)
Diffstat (limited to 'target/linux/ramips/mt7621/base-files/etc/board.d/02_network')
-rw-r--r--target/linux/ramips/mt7621/base-files/etc/board.d/02_network14
1 files changed, 9 insertions, 5 deletions
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
index ae8ee89d7f..2d119cb55e 100644
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
@@ -129,11 +129,10 @@ ramips_setup_macs()
wan_mac=$(mtd_get_mac_ascii u-boot-env et1macaddr)
label_mac=$(mtd_get_mac_binary factory 0x4)
;;
- beeline,smartbox-flash|\
- mts,wg430223)
- lan_mac=$(mtd_get_mac_ascii u-boot-env eth2macaddr)
- wan_mac=$(mtd_get_mac_ascii u-boot-env eth3macaddr)
- label_mac=$lan_mac
+ beeline,smartbox-flash)
+ wan_mac=$(mtd_get_mac_encrypted_arcadyan "board_data")
+ label_mac=$(macaddr_add "$wan_mac" 3)
+ lan_mac=$label_mac
;;
buffalo,wsr-1166dhp)
local index="$(find_mtd_index "board_data")"
@@ -196,6 +195,11 @@ ramips_setup_macs()
wan_mac=$label_mac
lan_mac=$(macaddr_add $label_mac 1)
;;
+ mts,wg430223)
+ wan_mac=$(mtd_get_mac_encrypted_arcadyan "board_data")
+ label_mac=$wan_mac
+ lan_mac=$(macaddr_add "$wan_mac" 2)
+ ;;
netgear,wax202)
lan_mac=$(mtd_get_mac_ascii Config mac)
wan_mac=$(macaddr_add "$lan_mac" 1)