]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fixed MFP Association Comeback mechanism to use Timeout Interval IE
authorJouni Malinen <jouni.malinen@atheros.com>
Mon, 19 Jan 2009 16:42:10 +0000 (18:42 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 19 Jan 2009 16:42:10 +0000 (18:42 +0200)
The separate Association Comeback Time IE was removed from IEEE 802.11w
and the Timeout Interval IE (from IEEE 802.11r) is used instead. The
editing on this is still somewhat incomplete in IEEE 802.11w/D7.0, but
still, the use of Timeout Interval IE is the expected mechanism.

hostapd/ieee802_11.c
src/common/ieee802_11_common.c
src/common/ieee802_11_common.h
src/common/ieee802_11_defs.h
wpa_supplicant/mlme.c

index 0faf6e17ca7e6a5cc15d414a47cc228795bb7a61..79688502bcbd4342f2ef80e87ffbf1131dd940d4 100644 (file)
@@ -301,8 +301,9 @@ static u8 * hostapd_eid_assoc_comeback_time(struct hostapd_data *hapd,
        u32 timeout, tu;
        struct os_time now, passed;
 
-       *pos++ = WLAN_EID_ASSOC_COMEBACK_TIME;
-       *pos++ = 4;
+       *pos++ = WLAN_EID_TIMEOUT_INTERVAL;
+       *pos++ = 5;
+       *pos++ = WLAN_TIMEOUT_ASSOC_COMEBACK;
        os_get_time(&now);
        os_time_sub(&now, &sta->sa_query_start, &passed);
        tu = (passed.sec * 1000000 + passed.usec) / 1024;
index 682d61b13582132d661930dfe235dcab95acf405..991c989d0233df260403d0a2865bc1ba9cd484cf 100644 (file)
@@ -219,6 +219,10 @@ ParseRes ieee802_11_parse_elems(u8 *start, size_t len,
                        elems->ftie = pos;
                        elems->ftie_len = elen;
                        break;
+               case WLAN_EID_TIMEOUT_INTERVAL:
+                       elems->timeout_int = pos;
+                       elems->timeout_int_len = elen;
+                       break;
                case WLAN_EID_HT_CAP:
                        elems->ht_capabilities = pos;
                        elems->ht_capabilities_len = elen;
@@ -227,10 +231,6 @@ ParseRes ieee802_11_parse_elems(u8 *start, size_t len,
                        elems->ht_operation = pos;
                        elems->ht_operation_len = elen;
                        break;
-               case WLAN_EID_ASSOC_COMEBACK_TIME:
-                       elems->assoc_comeback = pos;
-                       elems->assoc_comeback_len = elen;
-                       break;
                default:
                        unknown++;
                        if (!show_errors)
index 566da96f58bedb1fa3dbf507fc7ae62abffa6ce4..2aff9939f4acb94efc34e97979d87f16cb7c868a 100644 (file)
@@ -55,12 +55,12 @@ struct ieee802_11_elems {
        u8 mdie_len;
        u8 *ftie;
        u8 ftie_len;
+       u8 *timeout_int;
+       u8 timeout_int_len;
        u8 *ht_capabilities;
        u8 ht_capabilities_len;
        u8 *ht_operation;
        u8 ht_operation_len;
-       u8 *assoc_comeback;
-       u8 assoc_comeback_len;
        u8 *vendor_ht_cap;
        u8 vendor_ht_cap_len;
 };
index 88e6ce632ee4e421fd2e6db3d0e4b096542c3e42..18220b0fe5c2593b85b9e342cd9942926cd2bd25 100644 (file)
 #define WLAN_EID_20_40_BSS_INTOLERANT 73
 #define WLAN_EID_OVERLAPPING_BSS_SCAN_PARAMS 74
 #define WLAN_EID_MMIE 76
-#define WLAN_EID_ASSOC_COMEBACK_TIME 77
 #define WLAN_EID_VENDOR_SPECIFIC 221
 
 
 
 #define WLAN_SA_QUERY_TR_ID_LEN 16
 
+/* Timeout Interval Type */
+#define WLAN_TIMEOUT_REASSOC_DEADLINE 1
+#define WLAN_TIMEOUT_KEY_LIFETIME 2
+#define WLAN_TIMEOUT_ASSOC_COMEBACK 3
+
 
 #ifdef _MSC_VER
 #pragma pack(push, 1)
index 964b8c041bbefcb1ce69bc190dbb730f9df09b93..0c630673a09a11e2c069879bcd34739f78cbf0d1 100644 (file)
@@ -1087,9 +1087,10 @@ static void ieee80211_rx_mgmt_assoc_resp(struct wpa_supplicant *wpa_s,
                           status_code);
 #ifdef CONFIG_IEEE80211W
                if (status_code == WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY &&
-                   elems.assoc_comeback && elems.assoc_comeback_len == 4) {
+                   elems.timeout_int && elems.timeout_int_len == 5 &&
+                   elems.timeout_int[0] == WLAN_TIMEOUT_ASSOC_COMEBACK) {
                        u32 tu, ms;
-                       tu = WPA_GET_LE32(elems.assoc_comeback);
+                       tu = WPA_GET_LE32(elems.timeout_int + 1);
                        ms = tu * 1024 / 1000;
                        wpa_printf(MSG_DEBUG, "MLME: AP rejected association "
                                   "temporarily; comeback duration %u TU "