From: Daniel Gabay Date: Thu, 2 Nov 2023 13:21:52 +0000 (+0200) Subject: common: Fix ieee802_11_rsnx_capab() X-Git-Tag: hostap_2_11~882 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=056e6882902a2fbcb7088d12ec8c29a8b90963c1;p=thirdparty%2Fhostap.git common: Fix ieee802_11_rsnx_capab() The function should return bool (0/1) and not int. In some environments bool may be defined as unsigned char, so bits higher then 7 will be discarded during the downcast. Fix it. Signed-off-by: Daniel Gabay Signed-off-by: Andrei Otcheretianski --- diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c index 21c3ed701..093339cb4 100644 --- a/src/common/ieee802_11_common.c +++ b/src/common/ieee802_11_common.c @@ -2962,7 +2962,7 @@ bool ieee802_11_rsnx_capab_len(const u8 *rsnxe, size_t rsnxe_len, for (i = 0; i < flen; i++) capabs |= rsnxe[i] << (8 * i); - return capabs & BIT(capab); + return !!(capabs & BIT(capab)); }