MBO: Add support to ignore association disallowed set by AP
authorvamsi krishna <vamsin@qti.qualcomm.com>
Thu, 15 Sep 2016 07:40:58 +0000 (13:10 +0530)
committerJouni Malinen <j@w1.fi>
Sun, 25 Sep 2016 14:31:26 +0000 (17:31 +0300)
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 <jouni@qca.qualcomm.com>
wpa_supplicant/ctrl_iface.c
wpa_supplicant/events.c
wpa_supplicant/wpa_supplicant_i.h

index 0a46ed8..231464f 100644 (file)
@@ -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 */
 
index ed96228..6f8fc81 100644 (file)
@@ -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 */
index 39ed1f2..3b58593 100644 (file)
@@ -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;