From: Jouni Malinen Date: Sun, 8 May 2022 09:33:15 +0000 (+0300) Subject: BSS coloring: Fix bitmap check X-Git-Tag: hostap_2_11~1921 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=469528a6e5df9b9903d465e17e2562472e2dc4a1;p=thirdparty%2Fhostap.git BSS coloring: Fix bitmap check 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 --- diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 122d1660f..f6fe8a8a0 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -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;