mac80211: use the original mac address for the first virtual interface
authorFelix Fietkau <nbd@openwrt.org>
Tue, 23 Apr 2013 16:34:08 +0000 (16:34 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 23 Apr 2013 16:34:08 +0000 (16:34 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Backport of r36408

SVN-Revision: 36409

package/mac80211/files/lib/wifi/mac80211.sh

index 90282d65476ee096bb4f3491e45e781e71427a98..c3fbc5017ee2bad6061426bfd172e7c9aa85342d 100644 (file)
@@ -285,7 +285,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
        }