From 5494ce4d771c515ddea7b3297a89d810dfcfcfc5 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 13 Jul 2013 11:40:48 +0000 Subject: [PATCH] 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 Backport of r37269 SVN-Revision: 37270 --- package/mac80211/files/lib/wifi/mac80211.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 } -- 2.30.2