From 6ad37d73ca9faa1665e4ec54f4c859c2edc707dd Mon Sep 17 00:00:00 2001 From: vamsi krishna Date: Thu, 15 Sep 2016 13:10:58 +0530 Subject: [PATCH] MBO: Add support to ignore association disallowed set by AP Add a testing mechanism to allow association disallowed set by AP to be ignored. This can be used to verify AP behavior for disallowing a specific association. Signed-off-by: Jouni Malinen --- wpa_supplicant/ctrl_iface.c | 3 +++ wpa_supplicant/events.c | 7 +++++++ wpa_supplicant/wpa_supplicant_i.h | 1 + 3 files changed, 11 insertions(+) diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 0a46ed8..231464f 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -513,6 +513,8 @@ static int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s, wpa_s->p2p_go_csa_on_inv = !!atoi(value); } else if (os_strcasecmp(cmd, "ignore_auth_resp") == 0) { wpa_s->ignore_auth_resp = !!atoi(value); + } else if (os_strcasecmp(cmd, "ignore_assoc_disallow") == 0) { + wpa_s->ignore_assoc_disallow = !!atoi(value); #endif /* CONFIG_TESTING_OPTIONS */ #ifndef CONFIG_NO_CONFIG_BLOBS } else if (os_strcmp(cmd, "blob") == 0) { @@ -7202,6 +7204,7 @@ static void wpa_supplicant_ctrl_iface_flush(struct wpa_supplicant *wpa_s) wpa_s->test_failure = WPAS_TEST_FAILURE_NONE; wpa_s->p2p_go_csa_on_inv = 0; wpa_s->ignore_auth_resp = 0; + wpa_s->ignore_assoc_disallow = 0; wpa_sm_set_test_assoc_ie(wpa_s->wpa, NULL); #endif /* CONFIG_TESTING_OPTIONS */ diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index ed96228..6f8fc81 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -1101,6 +1101,10 @@ struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s, continue; } #ifdef CONFIG_MBO +#ifdef CONFIG_TESTING_OPTIONS + if (wpa_s->ignore_assoc_disallow) + goto skip_assoc_disallow; +#endif /* CONFIG_TESTING_OPTIONS */ assoc_disallow = wpas_mbo_get_bss_attr( bss, MBO_ATTR_ID_ASSOC_DISALLOW); if (assoc_disallow && assoc_disallow[1] >= 1) { @@ -1115,6 +1119,9 @@ struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s, " skip - MBO retry delay has not passed yet"); continue; } +#ifdef CONFIG_TESTING_OPTIONS + skip_assoc_disallow: +#endif /* CONFIG_TESTING_OPTIONS */ #endif /* CONFIG_MBO */ /* Matching configuration found */ diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index 39ed1f2..3b58593 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -1025,6 +1025,7 @@ struct wpa_supplicant { enum wpa_supplicant_test_failure test_failure; unsigned int p2p_go_csa_on_inv:1; unsigned int ignore_auth_resp:1; + unsigned int ignore_assoc_disallow:1; #endif /* CONFIG_TESTING_OPTIONS */ struct wmm_ac_assoc_data *wmm_ac_assoc_info; -- 2.1.4