summaryrefslogtreecommitdiff
path: root/package/mac80211/files/lib/wifi
diff options
context:
space:
mode:
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-03-12 13:52:20 +0000
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-03-12 13:52:20 +0000
commitd82ed54765d8e2ee38584fda570ff5b7a00ea0e3 (patch)
treea3740e586cff7d1355c5e8954321640bcadc83b7 /package/mac80211/files/lib/wifi
parent542169b5b17c9266431f3a45d60bdd328f252704 (diff)
[mac80211] fixes mbssid on ralink hardware
Signed-off-by: John Crispin <blogic@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35986 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/mac80211/files/lib/wifi')
-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 1ad3eb5086..4c214e84c5 100644
--- a/package/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/mac80211/files/lib/wifi/mac80211.sh
@@ -272,10 +272,12 @@ get_freq() {
mac80211_generate_mac() {
local off="$1"
local mac="$2"
+ local mask="$3"
local oIFS="$IFS"; IFS=":"; set -- $mac; IFS="$oIFS"
local b2mask=0x00
- [ $off -gt 0 ] && b2mask=0x02
+ [ $off -gt 0 ] &&
+ [ "$mask" = "00:00:00:00:00:00" -o $(( 0x${mask%%:*} & 0x2 )) -gt 0 ] && b2mask=0x02
printf "%02x:%s:%s:%s:%02x:%02x" \
$(( 0x$1 | $b2mask )) $2 $3 $4 \
@@ -375,7 +377,7 @@ enable_mac80211() {
config_get macaddr "$device" macaddr
config_get vif_mac "$vif" macaddr
[ -n "$vif_mac" ] || {
- vif_mac="$(mac80211_generate_mac $macidx $macaddr)"
+ vif_mac="$(mac80211_generate_mac $macidx $macaddr $(cat /sys/class/ieee80211/${phy}/address_mask))"
macidx="$(($macidx + 1))"
}
[ "$mode" = "ap" ] || ifconfig "$ifname" hw ether "$vif_mac"