1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-25 18:58:58 +02:00

mac80211: fix mac address handling for multiple phy/vif

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19177 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd 2010-01-17 01:52:45 +00:00
parent 9e219ca636
commit d9d6100edd

View File

@ -81,6 +81,7 @@ enable_mac80211() {
find_mac80211_phy "$device" || return 0 find_mac80211_phy "$device" || return 0
config_get phy "$device" phy config_get phy "$device" phy
local i=0 local i=0
local macidx=0
fixed="" fixed=""
[ -n "$country" ] && iw reg set "$country" [ -n "$country" ] && iw reg set "$country"
@ -147,12 +148,13 @@ enable_mac80211() {
config_get vif_mac "$vif" macaddr config_get vif_mac "$vif" macaddr
[ -n "$vif_mac" ] || { [ -n "$vif_mac" ] || {
if [ "$i" -gt 0 ]; then if [ "$macidx" -gt 0 ]; then
offset="$(( 2 + $i * 4 ))" offset="$(( 2 + $macidx * 4 ))"
else else
offset="0" offset="0"
fi fi
vif_mac="$( printf %02x $((0x$mac_1 + $offset)) ):$mac_2" vif_mac="$( printf %02x $((0x$mac_1 + $offset)) ):$mac_2"
macidx="$(($macidx + 1))"
} }
ifconfig "$ifname" hw ether "$vif_mac" ifconfig "$ifname" hw ether "$vif_mac"