Skip to content
Snippets Groups Projects
Commit a259e771 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-core: fixup WAN interface MAC address setting

parent a626c9a1
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
. /lib/functions.sh . /lib/functions.sh
. /lib/gluon/functions/sysconfig.sh . /lib/gluon/functions/sysconfig.sh
. /lib/ar71xx.sh
uci_remove network lan uci_remove network lan
...@@ -10,14 +12,14 @@ uci_set network wan type 'bridge' ...@@ -10,14 +12,14 @@ uci_set network wan type 'bridge'
uci_set network wan proto 'dhcp' uci_set network wan proto 'dhcp'
mainaddr=$(sysconfig primary_mac) case "$(ar71xx_board_name)" in
oIFS="$IFS"; IFS=":"; set -- $mainaddr; IFS="$oIFS"
b2mask=0x02
case "$board" in
tl-wr1043nd|\ tl-wr1043nd|\
tl-wdr3600|\ tl-wdr3600|\
tl-wdr4300) # fix up duplicate mac addresses tl-wdr4300) # fix up duplicate mac addresses
local mainaddr=$(sysconfig primary_mac)
local oIFS="$IFS"; IFS=":"; set -- $mainaddr; IFS="$oIFS"
local b2mask=0x02
local wanaddr=$(printf "%02x:%s:%s:%02x:%s:%02x" $(( 0x$1 | $b2mask )) $2 $3 $(( (0x$4 + 1) % 0x100 )) $5 $(( (0x$6 + 1) % 0x100 )) ) local wanaddr=$(printf "%02x:%s:%s:%02x:%s:%02x" $(( 0x$1 | $b2mask )) $2 $3 $(( (0x$4 + 1) % 0x100 )) $5 $(( (0x$6 + 1) % 0x100 )) )
uci_set network wan macaddr "$wanaddr" uci_set network wan macaddr "$wanaddr"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment