Interworking: Avoid busy loop in scan result mismatch corner cases
authorJouni Malinen <j@w1.fi>
Fri, 16 Jan 2015 23:43:00 +0000 (01:43 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 16 Jan 2015 23:52:07 +0000 (01:52 +0200)
commita8826b1848003eb84a6a287d4d71183ba2192dd6
treebb174c5dcd63b3e39bd20f4962b5ba50a5ae66d8
parentedd5939a26da9860f65e195bca730f8687e9d3e8
Interworking: Avoid busy loop in scan result mismatch corner cases

It was possible for interworking_find_network_match() to find a possible
BSS match in a case where more thorough checks in
wpa_supplicant_select_bss() reject network. This itself is fine, in
general, but when combined with wpa_supplicant_fast_associate()
optimization and auto_interworking=1, this resulted in a busy loop of up
to five seconds and a possible stack overflow due to recursion in that
loop.

Fix this by limiting the Interworking wpa_supplicant_fast_associate()
call to be used only once per scan iteration, so that new scan
operations can be completed before going through the scan results again.

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/interworking.c
wpa_supplicant/scan.c
wpa_supplicant/wpa_supplicant_i.h