summaryrefslogtreecommitdiffstats
path: root/package/mac80211/files/lib/wifi/mac80211.sh
diff options
context:
space:
mode:
Diffstat (limited to 'package/mac80211/files/lib/wifi/mac80211.sh')
-rw-r--r--package/mac80211/files/lib/wifi/mac80211.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/package/mac80211/files/lib/wifi/mac80211.sh b/package/mac80211/files/lib/wifi/mac80211.sh
index bb9721142..081dc4d88 100644
--- a/package/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/mac80211/files/lib/wifi/mac80211.sh
@@ -282,7 +282,9 @@ mac80211_generate_mac() {
local oIFS="$IFS"; IFS=":"; set -- $ref; IFS="$oIFS"
[ "$((0x$mask1))" -gt 0 ] && {
- b1=$(((0x$1 | 0x2) ^ ($id << 2)))
+ b1="0x$1"
+ [ "$id" -gt 0 ] && \
+ b1=$((($b1 | 0x2) ^ (($id - 1) << 2)))
printf "%02x:%s:%s:%s:%s:%s" $b1 $2 $3 $4 $5 $6
return
}