diff mbox

[1/1] STA: Request new scan only for the original interface

Message ID CAGCGobDv_o-TC2mzRE3FUKL+9DsCswvnfcB2A=EoJ_rjnZNXEA@mail.gmail.com
State Accepted
Headers show

Commit Message

Jithu Jance Nov. 12, 2013, 12:10 p.m. UTC
Hi Jouni,

On Fri, Nov 8, 2013 at 10:10 AM, Jithu Jance <jithujance@gmail.com> wrote:

> Hi Jouni,
>
>
> Maybe an additional "int own_request" argument for
>> wpas_select_network_from_last_scan() and using that to determine whether
>> to start the scan request at the end of the selected == NULL && ssid ==
>> NULL case?
>
>
> Makes sense. Thanks for your feedback. I will change the patch accordingly
> and resubmit it.
>
>
Kindly see whether the below patch is fine.


Signed-hostap: Jithu Jance <jithu@broadcom.com>
---
 wpa_supplicant/events.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

  struct wpa_ssid *ssid = NULL;
@@ -1342,7 +1342,12 @@ static int wpas_select_network_from_last_scan(struct
wpa_supplicant *wpa_s,
  wpa_supplicant_associate(wpa_s, NULL, ssid);
  if (new_scan)
  wpa_supplicant_rsn_preauth_scan_results(wpa_s);
- } else {
+ } else if (own_request) {
+ /*
+ *  No SSID found. If SCAN results are as a result of
+ *  own scan request and not due to a scan request on
+ *  another shared interface, try another scan.
+ * */
  int timeout_sec = wpa_s->scan_interval;
  int timeout_usec = 0;
 #ifdef CONFIG_P2P
@@ -1446,7 +1451,7 @@ int wpa_supplicant_fast_associate(struct
wpa_supplicant *wpa_s)
  return -1;
  }

- return wpas_select_network_from_last_scan(wpa_s, 0);
+ return wpas_select_network_from_last_scan(wpa_s, 0, 1);
 #endif /* CONFIG_NO_SCAN_PROCESSING */
 }

--
1.7.9.5


*> Jithu Jance*

Comments

Jouni Malinen Nov. 17, 2013, 4:29 p.m. UTC | #1
On Tue, Nov 12, 2013 at 05:40:23PM +0530, Jithu Jance wrote:
> Kindly see whether the below patch is fine.

Thanks, applied. Though, please note that the patch was whitespace
damaged and required manual merging. To save my time, I would highly
prefer patches to be sent in a way that does not modify their whitespace
either by configuring the email client to send unmodified plaintext
messages or if that does not work for some reason, at least sending the
patch in addition as an attachment.
Jithu Jance Nov. 18, 2013, 2:26 p.m. UTC | #2
Hi Jouni,


>Though, please note that the patch was whitespace
> damaged and required manual merging. To save my time, I would highly
> prefer patches to be sent in a way that does not modify their whitespace
> either by configuring the email client to send unmodified plaintext
> messages or if that does not work for some reason, at least sending the
> patch in addition as an attachment.
I was using mutt for sending out the patch emails. But last time I
made a mistake by copy pasting the patch as a reply to your email from
Gmail (and forgot to change the formatting to plain text). Sorry for
the trouble!




> Jithu Jance





On Sun, Nov 17, 2013 at 9:59 PM, Jouni Malinen <j@w1.fi> wrote:
> On Tue, Nov 12, 2013 at 05:40:23PM +0530, Jithu Jance wrote:
>> Kindly see whether the below patch is fine.
>
> Thanks, applied. Though, please note that the patch was whitespace
> damaged and required manual merging. To save my time, I would highly
> prefer patches to be sent in a way that does not modify their whitespace
> either by configuring the email client to send unmodified plaintext
> messages or if that does not work for some reason, at least sending the
> patch in addition as an attachment.
>
> --
> Jouni Malinen                                            PGP id EFC895FA
> _______________________________________________
> HostAP mailing list
> HostAP@lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
diff mbox

Patch

diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 4493772..ae2c07c 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -46,7 +46,7 @@ 

 #ifndef CONFIG_NO_SCAN_PROCESSING
 static int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s,
-      int new_scan);
+      int new_scan, int own_request);
 #endif /* CONFIG_NO_SCAN_PROCESSING */


@@ -1302,12 +1302,12 @@  static int
_wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,

  wpa_scan_results_free(scan_res);

- return wpas_select_network_from_last_scan(wpa_s, 1);
+ return wpas_select_network_from_last_scan(wpa_s, 1, own_request);
 }


 static int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s,
-      int new_scan)
+      int new_scan, int own_request)
 {
  struct wpa_bss *selected;