From 6108536d7d216fc742c2c85a11ac392ed386cfc8 Mon Sep 17 00:00:00 2001 From: Hu Wang Date: Mon, 10 Aug 2015 22:12:59 +0300 Subject: [PATCH] Drop connection attempt if network is disabled before radio work starts With the radio work design, it is possible for a network entry to get disabled (e.g., DISABLE_NETWORK ) during the time the connect or sme-connect radio work waits to start. Previously, only the validity of the BSS entry and BSSID/SSID was verified when starting the actual connection step. Add call to wpas_network_disabled() to those checks to catch the case where the network profile is disabled. Signed-off-by: Jouni Malinen --- wpa_supplicant/sme.c | 3 ++- wpa_supplicant/wpa_supplicant.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c index d945db7f7..54bb6c948 100644 --- a/wpa_supplicant/sme.c +++ b/wpa_supplicant/sme.c @@ -598,7 +598,8 @@ static void sme_auth_start_cb(struct wpa_radio_work *work, int deinit) wpa_s->connect_work = work; if (cwork->bss_removed || - !wpas_valid_bss_ssid(wpa_s, cwork->bss, cwork->ssid)) { + !wpas_valid_bss_ssid(wpa_s, cwork->bss, cwork->ssid) || + wpas_network_disabled(wpa_s, cwork->ssid)) { wpa_dbg(wpa_s, MSG_DEBUG, "SME: BSS/SSID entry for authentication not valid anymore - drop connection attempt"); wpas_connect_work_done(wpa_s); return; diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 277265e8f..816d5220a 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -1967,7 +1967,8 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit) wpa_s->connect_work = work; - if (cwork->bss_removed || !wpas_valid_bss_ssid(wpa_s, bss, ssid)) { + if (cwork->bss_removed || !wpas_valid_bss_ssid(wpa_s, bss, ssid) || + wpas_network_disabled(wpa_s, ssid)) { wpa_dbg(wpa_s, MSG_DEBUG, "BSS/SSID entry for association not valid anymore - drop connection attempt"); wpas_connect_work_done(wpa_s); return;