[PATCH] wpa_supplicant: set prev_sched_ssid only if needed

David Spinadel david.spinadel
Sun Nov 4 23:46:14 PST 2012


Set prev_sched_ssid only in case that there is no room
for another ssid, and there is at least one more ssid to scan.
Otherwise, when enabling or adding a new network during
scheduled scan, it will start the next iteration from the
last sched ssid, and won't scan for all networks.

Signed-off-by: David Spinadel <david.spinadel at intel.com>
---
 wpa_supplicant/scan.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index df663bc..38af84c 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -880,7 +880,6 @@ int wpa_supplicant_req_sched_scan(struct wpa_supplicant=
 *wpa_s)
                wpa_s->sched_scan_timeout =3D max_sched_scan_ssids * 2;
                wpa_s->first_sched_scan =3D 1;
                ssid =3D wpa_s->conf->ssid;
-               wpa_s->prev_sched_ssid =3D ssid;
        }

        if (wildcard) {
@@ -929,11 +928,12 @@ int wpa_supplicant_req_sched_scan(struct wpa_supplica=
nt *wpa_s)
                                         (wpas_network_disabled(wpa_s, ssid=
) ||
                                          !ssid->scan_ssid));
                                break;
+                               if (!ssid)
+                                       wpa_s->prev_sched_ssid =3D NULL;
                        }
                }

        next:
-               wpa_s->prev_sched_ssid =3D ssid;
                ssid =3D ssid->next;
        }

--
1.7.1

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

--_000_F781B6216F70FE49AB7B89F25E2F80C0BF1354HASMSX152gercorpi_
Content-Type: text/html; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii">
<meta name=3D"Generator" content=3D"Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left:=
 #800000 2px solid; } --></style>
</head>
<body>
<font face=3D"Calibri" size=3D"2"><span style=3D"font-size:11pt;">
<div>Hi,</div>
<div> </div>
<div>There are probably whitespaces problems, sorry. If you want this patch=
, I will find a way to send it without redundant things.</div>
<div> </div>
<div> </div>
<div>From 119a7496fa0e223adfd17456d1212f7099a55643 Mon Sep 17 00:00:00 2001=
</div>
<div>From: David Spinadel <david.spinadel at intel.com></div>
<div>Date: Mon, 5 Nov 2012 09:46:14 +0200</div>
<div>Subject: [PATCH] wpa_supplicant: set prev_sched_ssid only if needed</d=
iv>
<div> </div>
<div>Set prev_sched_ssid only in case that there is no room</div>
<div>for another ssid, and there is at least one more ssid to scan.</div>
<div>Otherwise, when enabling or adding a new network during</div>
<div>scheduled scan, it will start the next iteration from the</div>
<div>last sched ssid, and won't scan for all networks.</div>
<div> </div>
<div>Signed-off-by: David Spinadel <david.spinadel at intel.com></div>
<div>---</div>
<div> wpa_supplicant/scan.c |    4 ++--</div>
<div> 1 files changed, 2 insertions(+), 2 deletions(-)</div>
<div> </div>
<div>diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c</div>
<div>index df663bc..38af84c 100644</div>
<div>--- a/wpa_supplicant/scan.c</div>
<div>+++ b/wpa_supplicant/scan.c</div>
<div>@@ -880,7 +880,6 @@ int wpa_supplicant_req_sched_scan(struct wpa_s=
upplicant *wpa_s)</div>
<div>           &nbs=
p;     wpa_s->sched_scan_timeout =3D max_sched_scan_=
ssids * 2;</div>
<div>           &nbs=
p;     wpa_s->first_sched_scan =3D 1;</div>
<div>           &nbs=
p;     ssid =3D wpa_s->conf->ssid;</div>
<div>-           &nb=
sp;   wpa_s->prev_sched_ssid =3D ssid;</div>
<div>         }</div>
<div> </div>
<div>         if (wildcard) {</div>
<div>@@ -929,11 +928,12 @@ int wpa_supplicant_req_sched_scan(struct wpa=
_supplicant *wpa_s)</div>
<div>           &nbs=
p;            &=
nbsp;           &nbs=
p;     (wpas_network_disabled(wpa_s, ssid) ||</div>
<div>           &nbs=
p;            &=
nbsp;           &nbs=
p;      !ssid->scan_ssid));</div>
<div>           &nbs=
p;            &=
nbsp;        break;</div>
<div>+          &nbsp=
;            &n=
bsp;       if (!ssid)</div>
<div>+          &nbsp=
;            &n=
bsp;           &nbsp=
;   wpa_s->prev_sched_ssid =3D NULL;</div>
<div>           &nbs=
p;             =
}</div>
<div>           &nbs=
p;     }</div>
<div> </div>
<div>         next:</div>
<div>-           &nb=
sp;   wpa_s->prev_sched_ssid =3D ssid;</div>
<div>           &nbs=
p;     ssid =3D ssid->next;</div>
<div>         }</div>
<div> </div>
<div>-- </div>
<div>1.7.1</div>
<div> </div>
</span></font>
<p>---------------------------------------------------------------------<br>
Intel Israel (74) Limited</p>

<p>This e-mail and any attachments may contain confidential material for<br>
the sole use of the intended recipient(s). Any review or distribution<br>
by others is strictly prohibited. If you are not the intended<br>
recipient, please contact the sender and delete all copies.</p></body>
</html>

--_000_F781B6216F70FE49AB7B89F25E2F80C0BF1354HASMSX152gercorpi_--




More information about the Hostap mailing list