[PATCH] More strict when estimate whether a bss is in used

Jouni Malinen j
Sat Dec 14 21:02:19 PST 2013


On Wed, Dec 11, 2013 at 05:03:37PM +0800, Guoqiang Liu wrote:
> If AP change the ssid, wpa_suuplicant only remove the previous bss
> enrty when the one not be included in scan result twice, as the
> DEFAULT_BSS_EXPIRATION_SCAN_COUNT is 2. and it have enough time for
> AP broadcasts new beacons frame with new ssid before the previous
> bss removed, and then two bss will share a same bssid.
> 
> If new ssid is connected before. it will auto connect it, which
> will result in the previous bss enrty always in used, but it is
> invalid, the root cause is that wpa_suuplicant only distinguish
> different bsses base on bssid. but ssid shoud be check too.

Please read the top level CONTRIBUTIONS file and add a Signed-hostap:
tag into the commit message as described there.

I'm not completely sure I understood what the real problem here is.
Could you please clarify where this causes issues?

> diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
>  static int wpa_bss_in_use(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)

> +	if (os_memcmp(bss->bssid, wpa_s->bssid, ETH_ALEN) == 0 ||
> +		os_memcmp(bss->bssid, wpa_s->pending_bssid, ETH_ALEN) == 0) {
> +		/*
> +		 * It not enough to only compare bssid to distinguish a bss,
> +		 * the case two bss share a same bssid can occurs if AP change
> +		 * SSID.
> +		 */
> +		int ssid_len = wpa_s->current_ssid->ssid_len;

This looks risky.. Couldn't wpa_s->current_ssid be NULL here?

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list