diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-01-17 01:52:45 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2010-01-17 01:52:45 +0000 |
commit | 8bdee4acf7fac4a8dc0661cf6addbadfa020b959 (patch) | |
tree | 9fd89a0a7e2b8f51f175675f6f19fa43e9edb7f1 /package/mac80211 | |
parent | 20daaf74805b5adfae2874edcd049b2c827d05df (diff) | |
download | mtk-20170518-8bdee4acf7fac4a8dc0661cf6addbadfa020b959.zip mtk-20170518-8bdee4acf7fac4a8dc0661cf6addbadfa020b959.tar.gz mtk-20170518-8bdee4acf7fac4a8dc0661cf6addbadfa020b959.tar.bz2 |
mac80211: fix mac address handling for multiple phy/vif
SVN-Revision: 19177
Diffstat (limited to 'package/mac80211')
-rw-r--r-- | package/mac80211/files/lib/wifi/mac80211.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/package/mac80211/files/lib/wifi/mac80211.sh b/package/mac80211/files/lib/wifi/mac80211.sh index 82ff958..dea5722 100644 --- a/package/mac80211/files/lib/wifi/mac80211.sh +++ b/package/mac80211/files/lib/wifi/mac80211.sh @@ -81,6 +81,7 @@ enable_mac80211() { find_mac80211_phy "$device" || return 0 config_get phy "$device" phy local i=0 + local macidx=0 fixed="" [ -n "$country" ] && iw reg set "$country" @@ -147,12 +148,13 @@ enable_mac80211() { config_get vif_mac "$vif" macaddr [ -n "$vif_mac" ] || { - if [ "$i" -gt 0 ]; then - offset="$(( 2 + $i * 4 ))" + if [ "$macidx" -gt 0 ]; then + offset="$(( 2 + $macidx * 4 ))" else offset="0" fi vif_mac="$( printf %02x $((0x$mac_1 + $offset)) ):$mac_2" + macidx="$(($macidx + 1))" } ifconfig "$ifname" hw ether "$vif_mac" |