[PATCH] wpa_supplicant: set prev_sched_ssid only if needed

David Spinadel david.spinadel at intel.com
Mon Nov 5 02:46:14 EST 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>&nbsp;</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>&nbsp;</div>
<div>&nbsp;</div>
<div>From 119a7496fa0e223adfd17456d1212f7099a55643 Mon Sep 17 00:00:00 2001=
</div>
<div>From: David Spinadel &lt;david.spinadel at intel.com&gt;</div>
<div>Date: Mon, 5 Nov 2012 09:46:14 &#43;0200</div>
<div>Subject: [PATCH] wpa_supplicant: set prev_sched_ssid only if needed</d=
iv>
<div>&nbsp;</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>&nbsp;</div>
<div>Signed-off-by: David Spinadel &lt;david.spinadel at intel.com&gt;</div>
<div>---</div>
<div> wpa_supplicant/scan.c |&nbsp;&nbsp;&nbsp; 4 &#43;&#43;--</div>
<div> 1 files changed, 2 insertions(&#43;), 2 deletions(-)</div>
<div>&nbsp;</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>&#43;&#43;&#43; b/wpa_supplicant/scan.c</div>
<div>@@ -880,7 &#43;880,6 @@ int wpa_supplicant_req_sched_scan(struct wpa_s=
upplicant *wpa_s)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp; wpa_s-&gt;sched_scan_timeout =3D max_sched_scan_=
ssids * 2;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp; wpa_s-&gt;first_sched_scan =3D 1;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp; ssid =3D wpa_s-&gt;conf-&gt;ssid;</div>
<div>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; wpa_s-&gt;prev_sched_ssid =3D ssid;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (wildcard) {</div>
<div>@@ -929,11 &#43;928,12 @@ int wpa_supplicant_req_sched_scan(struct wpa=
_supplicant *wpa_s)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp; (wpas_network_disabled(wpa_s, ssid) ||</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbs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p;&nbsp;&nbsp;&nbsp;&nbsp; next:</div>
<div>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; wpa_s-&gt;prev_sched_ssid =3D ssid;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp; ssid =3D ssid-&gt;next;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</div>
<div>&nbsp;</div>
<div>-- </div>
<div>1.7.1</div>
<div>&nbsp;</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