aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-07-13 11:39:48 +0000
committerFelix Fietkau <nbd@openwrt.org>2013-07-13 11:39:48 +0000
commit299c2ceafa1c8382e0e7e7a8706ea0b56dcc3261 (patch)
tree5160c49a6cc5f027faff2d760938d86b23d09f19
parent9e9261a7182c82947f1bbd7f63aa6a93a783e02e (diff)
downloadupstream-299c2ceafa1c8382e0e7e7a8706ea0b56dcc3261.tar.gz
upstream-299c2ceafa1c8382e0e7e7a8706ea0b56dcc3261.tar.bz2
upstream-299c2ceafa1c8382e0e7e7a8706ea0b56dcc3261.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> SVN-Revision: 37269
-rw-r--r--package/kernel/mac80211/files/lib/wifi/mac80211.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
index a052a1cbfb..20f6bfa93c 100644
--- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/kernel/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
}