diff mbox

Interworking: Re-trigger scan if no connect attempt is done

Message ID CACZXzRDXNpcAAqYgLcVQ-YUz1Ku4Ygz7kqPw04-CEPw+nbos-w@mail.gmail.com
State Accepted
Headers show

Commit Message

Mikael Kanstrup May 28, 2014, 11:26 a.m. UTC
For one specific case when running with interworking enabled
the re-initialisation of the background scan timer is missing.
This makes auto connect to a configured network fail.

The case is:
- Interworking credentials available
- Auto interworking is enabled
- Interwokring auto select is disabled
- No configured (enabled and non blacklisted) networks are present
  in scan results list.
- Interworking finds matching networks

This patch covers the case and re-initialises the background scan
timer.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
---
 wpa_supplicant/interworking.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

                if (wpa_s->auto_network_select) {
--
1.8.2.2

Comments

Jouni Malinen May 31, 2014, 3:46 p.m. UTC | #1
On Wed, May 28, 2014 at 01:26:34PM +0200, Mikael Kanstrup wrote:
> For one specific case when running with interworking enabled
> the re-initialisation of the background scan timer is missing.
> This makes auto connect to a configured network fail.

Thanks, applied.

> The case is:
> - Interworking credentials available
> - Auto interworking is enabled
> - Interwokring auto select is disabled
> - No configured (enabled and non blacklisted) networks are present
>   in scan results list.
> - Interworking finds matching networks

Though, this looks somewhat inaccurate or at least the test case I was
able to generate has the "No configured networks" replaced with "No
fully matching networks", i.e., for Interworking find to find a match,
there needs to be an enabled network. Anyway, the fix itself remains
as-is.
Mikael Kanstrup June 2, 2014, 8:25 a.m. UTC | #2
2014-05-31 17:46 GMT+02:00 Jouni Malinen <j@w1.fi>:
> On Wed, May 28, 2014 at 01:26:34PM +0200, Mikael Kanstrup wrote:
>> For one specific case when running with interworking enabled
>> the re-initialisation of the background scan timer is missing.
>> This makes auto connect to a configured network fail.
>
> Thanks, applied.
>
>> The case is:
>> - Interworking credentials available
>> - Auto interworking is enabled
>> - Interwokring auto select is disabled
>> - No configured (enabled and non blacklisted) networks are present
>>   in scan results list.
>> - Interworking finds matching networks
>
> Though, this looks somewhat inaccurate or at least the test case I was
> able to generate has the "No configured networks" replaced with "No
> fully matching networks", i.e., for Interworking find to find a match,
> there needs to be an enabled network. Anyway, the fix itself remains
> as-is.

I was not clear enough on the scenario. This is the whole scenario:

- Interworking credentials available
- Auto interworking is enabled
- Interworking auto select is disabled

Then configure a network and associate to it. Go out of AP range (or
turn AP off). AP is kept cached in scan results until aging algorithm
removes them later on. Supplicant tries to associate a number of times
before the network is marked as temporarily disabled. After this
interworking kicks in and finds the just disabled network as a
candidate to connect to (through function
interworking_find_network_match) but decides not to connect to it
(auto select disabled). Now no scan timer is setup. The patch solves
this case.

Regards
Mikael Kanstrup
Jouni Malinen June 2, 2014, 12:13 p.m. UTC | #3
On Mon, Jun 02, 2014 at 10:25:44AM +0200, Mikael Kanstrup wrote:
> Then configure a network and associate to it. Go out of AP range (or
> turn AP off). AP is kept cached in scan results until aging algorithm
> removes them later on. Supplicant tries to associate a number of times
> before the network is marked as temporarily disabled. After this
> interworking kicks in and finds the just disabled network as a
> candidate to connect to (through function
> interworking_find_network_match) but decides not to connect to it
> (auto select disabled). Now no scan timer is setup. The patch solves
> this case.

Ah, interesting. I used a bit different mechanism to trigger this in my
testing (use same SSID but different security parameters), but anyway,
the end result is same with the key being in the two different places
looking at scan results doing a different determination on possible
matches.
diff mbox

Patch

diff --git a/wpa_supplicant/interworking.c b/wpa_supplicant/interworking.c
index a8ecb8c..6d1539c 100644
--- a/wpa_supplicant/interworking.c
+++ b/wpa_supplicant/interworking.c
@@ -2397,9 +2397,10 @@  static void interworking_select_network(struct
wpa_supplicant *wpa_s)
                if (interworking_find_network_match(wpa_s)) {
                        wpa_printf(MSG_DEBUG, "Interworking: Possible BSS "
                                   "match for enabled network configurations");
-                       if (wpa_s->auto_select)
+                       if (wpa_s->auto_select) {
                                interworking_reconnect(wpa_s);
-                       return;
+                               return;
+                       }
                }