[PATCH] RRM: Fix number of SSIDs in scan for beacon report

Jouni Malinen j at w1.fi
Wed Mar 8 06:01:47 PST 2017


On Wed, Mar 08, 2017 at 10:54:37AM +0200, Andrei Otcheretianski wrote:
> When requesting a scan for beacon report request, the number of
> SSIDs is always set to one, even when no SSID subelement is
> present in the measurement request.

Only when Measurement Mode is set to Active; not always (i.e.,
Measurement Mode set to Passive would not do this)..

> Fix this by setting the SSID in the scan parameters only if the
> SSID subelement is actually present in the measurement request.

What is the incorrect behavior that this is fixing?

> diff --git a/wpa_supplicant/rrm.c b/wpa_supplicant/rrm.c
> @@ -1085,7 +1085,7 @@ wpas_rm_handle_beacon_req(struct wpa_supplicant *wpa_s,
>  
>  	params->only_new_results = 1;
>  
> -	if (req->mode == BEACON_REPORT_MODE_ACTIVE) {
> +	if (req->mode == BEACON_REPORT_MODE_ACTIVE && data->ssid_len) {
>  		params->ssids[params->num_ssids].ssid = data->ssid;
>  		params->ssids[params->num_ssids++].ssid_len = data->ssid_len;
>  	}

This is a beacon report request with Measurement Mode having value
Active. That indicates that there is a request to do an active scan. If
the SSID subelement is not included in the Beacon request, this is a
request to report all BSSs regardless of the SSID. For this to use an
active scan, params->num_ssids needs to be 1 and a zero length SSID
needs to be specified as the SSID to scan for.

The proposed change seems to break the expected behavior for Measurement
Mode = Active. As such, I'm not applying this without more thorough
commit message explaining why the current behavior is incorrect
(ideally, point to the IEEE 802.11 standard clause describing this; IEEE
Std 802.11-2016, 11.11.9.1 (Beacon report) seems to match the current
implementation behavior).
 
-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list