wlantest: Verify that comeback assoc resp includes correct type
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 20 Sep 2011 17:13:18 +0000 (20:13 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 20 Sep 2011 17:13:18 +0000 (20:13 +0300)
The Timeout Interval element needs to use Association Comeback time
for the case when (Re)Association Response frame uses Status Code 30.
Verify this before incrementing the (re)assocresp_comeback counters.

wlantest/rx_mgmt.c

index 6772376..6f7fd40 100644 (file)
@@ -336,10 +336,13 @@ static void rx_mgmt_assoc_resp(struct wlantest *wt, const u8 *data, size_t len)
                        wpa_printf(MSG_INFO, "Failed to parse IEs in "
                                   "AssocResp from " MACSTR,
                                   MAC2STR(mgmt->sa));
-               } else if (elems.timeout_int == 0 ||
-                          elems.timeout_int_len != 5) {
-                       wpa_printf(MSG_INFO, "No valid Timeout Interval IE in "
-                                  "AssocResp (status=30) from " MACSTR,
+               } else if (elems.timeout_int == NULL ||
+                          elems.timeout_int_len != 5 ||
+                          elems.timeout_int[0] !=
+                          WLAN_TIMEOUT_ASSOC_COMEBACK) {
+                       wpa_printf(MSG_INFO, "No valid Timeout Interval IE "
+                                  "with Assoc Comeback time in AssocResp "
+                                  "(status=30) from " MACSTR,
                                   MAC2STR(mgmt->sa));
                } else {
                        sta->counters[
@@ -465,10 +468,13 @@ static void rx_mgmt_reassoc_resp(struct wlantest *wt, const u8 *data,
                        wpa_printf(MSG_INFO, "Failed to parse IEs in "
                                   "ReassocResp from " MACSTR,
                                   MAC2STR(mgmt->sa));
-               } else if (elems.timeout_int == 0 ||
-                          elems.timeout_int_len != 5) {
-                       wpa_printf(MSG_INFO, "No valid Timeout Interval IE in "
-                                  "ReassocResp (status=30) from " MACSTR,
+               } else if (elems.timeout_int == NULL ||
+                          elems.timeout_int_len != 5 ||
+                          elems.timeout_int[0] !=
+                          WLAN_TIMEOUT_ASSOC_COMEBACK) {
+                       wpa_printf(MSG_INFO, "No valid Timeout Interval IE "
+                                  "with Assoc Comeback time in ReassocResp "
+                                  "(status=30) from " MACSTR,
                                   MAC2STR(mgmt->sa));
                } else {
                        sta->counters[