]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
BSS coloring: Fix bitmap check
authorJouni Malinen <j@w1.fi>
Sun, 8 May 2022 09:33:15 +0000 (12:33 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 8 May 2022 13:36:09 +0000 (16:36 +0300)
BIT(r) is not sufficient here since it does not cover 64 bit values.
Write this out with 1ULL to be large enough for the shift operation.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/hostapd.c

index 122d1660fbdb69a957ece5380bc27bb2e6ee79d9..f6fe8a8a03b522d7302c6b7b11b94153c99e5aed 100644 (file)
@@ -3804,7 +3804,7 @@ static void hostapd_switch_color_timeout_handler(void *eloop_data,
 
        r = os_random() % HE_OPERATION_BSS_COLOR_MAX;
        for (i = 0; i < HE_OPERATION_BSS_COLOR_MAX; i++) {
-               if (r && !(hapd->color_collision_bitmap & BIT(r)))
+               if (r && !(hapd->color_collision_bitmap & (1ULL << r)))
                        break;
 
                r = (r + 1) % HE_OPERATION_BSS_COLOR_MAX;