summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-01-17 01:52:45 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-01-17 01:52:45 +0000
commitd9d6100edd9b4229398ffc177bd3aff826308377 (patch)
treea1c7b0049579874eb6112185eaea686ee664058d /package
parent9e219ca63654c28f0f63378a4f176fb8da6d5b5e (diff)
mac80211: fix mac address handling for multiple phy/vif
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19177 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r--package/mac80211/files/lib/wifi/mac80211.sh6
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 82ff958222..dea57223bc 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"