[PATCH] Prevent explicit scan command during scan or association
Dmitry Shmidt
dimitrysh
Mon Apr 11 15:12:54 PDT 2011
On Mon, Apr 11, 2011 at 11:44 AM, Jouni Malinen <j at w1.fi> wrote:
> On Fri, Apr 08, 2011 at 03:45:12PM -0700, Dmitry Shmidt wrote:
>> diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
>> index 4f3f7e0..c48d1a7 100644
>> @@ -3181,8 +3181,14 @@ char * wpa_supplicant_ctrl_iface_process(struct
>> wpa_supplicant *wpa_s,
>> ? ? ? ? ? ? ? if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED)
>> ? ? ? ? ? ? ? ? ? ? ? reply_len = -1;
>> ? ? ? ? ? ? ? else {
>> - ? ? ? ? ? ? ? ? ? ? wpa_s->scan_req = 2;
>> - ? ? ? ? ? ? ? ? ? ? wpa_supplicant_req_scan(wpa_s, 0, 0);
>> + ? ? ? ? ? ? ? ? ? ? if (!wpa_s->scanning &&
>> + ? ? ? ? ? ? ? ? ? ? ? ? ((wpa_s->wpa_state <= WPA_SCANNING) ||
>> + ? ? ? ? ? ? ? ? ? ? ? ? ?(wpa_s->wpa_state == WPA_COMPLETED))) {
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? wpa_s->scan_req = 2;
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? wpa_supplicant_req_scan(wpa_s, 0, 0);
>> + ? ? ? ? ? ? ? ? ? ? } else {
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? wpa_printf(MSG_ERROR, "Ongoing Scan action");
>> + ? ? ? ? ? ? ? ? ? ? }
>
> Hmm.. This would still indicate success to the program that requested
> the scan. That does not sound reasonable. At minimum, this would need to
> return something like FAIL-BUSY instead of OK in the case that the
> request was not accepted. It should also be noted that scan request can
> be made over the D-Bus interface and it would probably be a good idea to
> handle these in the same way with the ctrl_interface command.
You are right, different status makes sense. Patch is attached.
About d-bus - I hope somebody that can test it can do this similar patch.
>
> --
> Jouni Malinen ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?PGP id EFC895FA
> _______________________________________________
> HostAP mailing list
> HostAP at lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Prevent-explicit-scan-command-during-scan-or-associa.patch
Type: application/octet-stream
Size: 1253 bytes
Desc: not available
Url : http://lists.shmoo.com/pipermail/hostap/attachments/20110411/bea30ae1/attachment.obj
More information about the Hostap
mailing list