mirror of
https://github.com/openwrt/openwrt.git
synced 2025-02-07 11:30:37 +00:00
fixes mbssid on ralink hardware
Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 35986
This commit is contained in:
parent
76934b6779
commit
d0ddec11bb
@ -272,10 +272,12 @@ get_freq() {
|
|||||||
mac80211_generate_mac() {
|
mac80211_generate_mac() {
|
||||||
local off="$1"
|
local off="$1"
|
||||||
local mac="$2"
|
local mac="$2"
|
||||||
|
local mask="$3"
|
||||||
local oIFS="$IFS"; IFS=":"; set -- $mac; IFS="$oIFS"
|
local oIFS="$IFS"; IFS=":"; set -- $mac; IFS="$oIFS"
|
||||||
|
|
||||||
local b2mask=0x00
|
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" \
|
printf "%02x:%s:%s:%s:%02x:%02x" \
|
||||||
$(( 0x$1 | $b2mask )) $2 $3 $4 \
|
$(( 0x$1 | $b2mask )) $2 $3 $4 \
|
||||||
@ -375,7 +377,7 @@ enable_mac80211() {
|
|||||||
config_get macaddr "$device" macaddr
|
config_get macaddr "$device" macaddr
|
||||||
config_get vif_mac "$vif" macaddr
|
config_get vif_mac "$vif" macaddr
|
||||||
[ -n "$vif_mac" ] || {
|
[ -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))"
|
macidx="$(($macidx + 1))"
|
||||||
}
|
}
|
||||||
[ "$mode" = "ap" ] || ifconfig "$ifname" hw ether "$vif_mac"
|
[ "$mode" = "ap" ] || ifconfig "$ifname" hw ether "$vif_mac"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user