diff options
author | John Crispin <blogic@openwrt.org> | 2013-02-25 13:41:50 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2013-02-25 13:41:50 +0000 |
commit | 5c84e93c8a37df1075be0e3b9806daa442e67b4f (patch) | |
tree | 7b6d326e2706a2ed2ac9a06de21b6dfd32e1a9a1 | |
parent | fe6b56b0082ade3017ea2445204e5af35b5ad87a (diff) | |
download | upstream-5c84e93c8a37df1075be0e3b9806daa442e67b4f.tar.gz upstream-5c84e93c8a37df1075be0e3b9806daa442e67b4f.tar.bz2 upstream-5c84e93c8a37df1075be0e3b9806daa442e67b4f.zip |
[mac80211] fixes mbssid on ralink hardware
Signed-off-by: John Crispin <blogic@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/branches/attitude_adjustment@35781 3c298f89-4303-0410-b956-a3cf2f4a3e73
-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 db132af735..31078f1a61 100644 --- a/package/mac80211/files/lib/wifi/mac80211.sh +++ b/package/mac80211/files/lib/wifi/mac80211.sh @@ -275,10 +275,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 \ @@ -378,7 +380,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" |