[PATCH v2] Fix scan retry after a failure

Kalle Valo kalle.valo
Tue Nov 9 23:57:06 PST 2010


Jouni Malinen <j at w1.fi> writes:

> On Fri, Oct 15, 2010 at 02:14:47PM +0300, Kalle Valo wrote:
>> @@ -891,8 +892,14 @@ static void wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
>>  	if (scan_res == NULL) {
>>  		if (wpa_s->conf->ap_scan == 2 || ap)
>>  			return;
>> +
>> +		if (wpa_s->scan_runs != 1)
>> +			/* only try rescan on first attempt */
>> +			return;
>
> This does not look desirable.. It would break things with many drivers
> that have problems accepting scan results..
>> +
>>  		wpa_printf(MSG_DEBUG, "Failed to get scan results - try "
>>  			   "scanning again");
>> +		wpa_s->scan_req = 1;
>>  		wpa_supplicant_req_new_scan(wpa_s, 1, 0);
>
> I would have assumed the if (scan_runs == 1) would be a condition just
> for this wpa_s->scan_req = 1 change, not for the current behavior of
> trying to recover from scan request failures..

Ah, sorry. I misunderstood you, I was under impression that you wanted
the whole retransmit logic only to happen during the first scan. I'll
fix that as you proposed.

> Am I missing something here and was this condition added on purpose
> for the wpa_supplicant_req_new_scan() call, too?

Most probably you are not missing anything. I added the change to
wpa_supplicant_req_new_scan() because otherwise it would take a long
time until wpasupplicant goes back to inactive state (from scanning
state).

-- 
Kalle Valo



More information about the Hostap mailing list