diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-07-13 11:40:48 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-07-13 11:40:48 +0000 |
commit | 28aadc725d8ae319c4b98e87ffb55b11d4f36f4e (patch) | |
tree | 71e2d624573bd576409cc97836b50c61c50ce8c2 | |
parent | 32f8e1d2dfca21641364cf59b58a6fc28912aacc (diff) | |
download | upstream-28aadc725d8ae319c4b98e87ffb55b11d4f36f4e.tar.gz upstream-28aadc725d8ae319c4b98e87ffb55b11d4f36f4e.tar.bz2 upstream-28aadc725d8ae319c4b98e87ffb55b11d4f36f4e.zip |
mac80211: tweak mac address allocation
Apparently there are some broken devices out there that have the local
bit already set in the factory MAC address. Move the | 0x2 over to the
other side of the xor operation to fix this without affecting devices
with proper addresses.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Backport of r37269
git-svn-id: svn://svn.openwrt.org/openwrt/branches/attitude_adjustment@37270 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | package/mac80211/files/lib/wifi/mac80211.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/package/mac80211/files/lib/wifi/mac80211.sh b/package/mac80211/files/lib/wifi/mac80211.sh index a052a1cbfb..20f6bfa93c 100644 --- a/package/mac80211/files/lib/wifi/mac80211.sh +++ b/package/mac80211/files/lib/wifi/mac80211.sh @@ -284,7 +284,7 @@ mac80211_generate_mac() { [ "$((0x$mask1))" -gt 0 ] && { b1="0x$1" [ "$id" -gt 0 ] && \ - b1=$((($b1 | 0x2) ^ (($id - 1) << 2))) + b1=$(($b1 ^ ((($id - 1) << 2) | 0x2))) printf "%02x:%s:%s:%s:%s:%s" $b1 $2 $3 $4 $5 $6 return } |