[PATCH] Fix bss_is_ess() in case of an IBSS network

Jouni Malinen j at w1.fi
Fri Sep 13 06:31:34 PDT 2019

On Thu, Sep 12, 2019 at 04:04:29PM -0600, Ahmed Zaki wrote:
> The check for the ESS or IBSS bits in the BSS caps is done via equality
> to IEEE80211_CAP_ESS (0x01). This will only be true for AP/ESS and will
> fail in case of IBSS (0x02).

What do you mean with "fail" in this context? An IBSS is not an ESS, so
it sounds correct to me for bss_is_ess() to return 0 if the BSS is an

> diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
> @@ -906,8 +906,7 @@ static int bss_is_ess(struct wpa_bss *bss)
>  			IEEE80211_CAP_DMG_AP;
>  	}
> -	return ((bss->caps & (IEEE80211_CAP_ESS | IEEE80211_CAP_IBSS)) ==
> -		IEEE80211_CAP_ESS);
> +	return (bss->caps & IEEE80211_CAP_ESS || bss->caps & IEEE80211_CAP_IBSS);

This would break bss_is_ess() by making it incorrectly claim an IBSS to
be an IBSS. Please note that the only caller of bss_is_ess() used to
originally do "if (bss->caps & IEEE80211_CAP_IBSS) continue" which is
what is still happening with the current bss_is_ess() implementation
while this proposed change would negate that.

What are you trying to fix with this?

Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list