]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Remove unused STA entry information
authorJouni Malinen <j@w1.fi>
Sat, 15 Mar 2014 07:57:10 +0000 (09:57 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 15 Mar 2014 07:57:10 +0000 (09:57 +0200)
previous_ap and last_assoc_req were not really used for anything
meaninful, so get rid of them to reduce the size of per-STA memory
allocation.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/ap_mlme.c
src/ap/iapp.c
src/ap/ieee802_11.c
src/ap/sta_info.c
src/ap/sta_info.h

index a7129f14b26beea58f4eac56c8988556d04afd29..13604edc49406e0a78e9dc57cb487d9d0a63e24e 100644 (file)
@@ -120,8 +120,6 @@ void mlme_associate_indication(struct hostapd_data *hapd, struct sta_info *sta)
  * reassociation procedure that was initiated by that specific peer MAC entity.
  *
  * PeerSTAAddress = sta->addr
- *
- * sta->previous_ap contains the "Current AP" information from ReassocReq.
  */
 void mlme_reassociate_indication(struct hostapd_data *hapd,
                                 struct sta_info *sta)
index bad080f028bc1ddc5a6fa1033bca03982a65fcac..9b2900f235e374f6755fa3baf2aabc039f811011 100644 (file)
@@ -242,29 +242,22 @@ static void iapp_send_layer2_update(struct iapp_data *iapp, u8 *addr)
  */
 void iapp_new_station(struct iapp_data *iapp, struct sta_info *sta)
 {
-       struct ieee80211_mgmt *assoc;
-       u16 seq;
+       u16 seq = 0; /* TODO */
 
        if (iapp == NULL)
                return;
 
-       assoc = sta->last_assoc_req;
-       seq = assoc ? WLAN_GET_SEQ_SEQ(le_to_host16(assoc->seq_ctrl)) : 0;
-
        /* IAPP-ADD.request(MAC Address, Sequence Number, Timeout) */
        hostapd_logger(iapp->hapd, sta->addr, HOSTAPD_MODULE_IAPP,
                       HOSTAPD_LEVEL_DEBUG, "IAPP-ADD.request(seq=%d)", seq);
        iapp_send_layer2_update(iapp, sta->addr);
        iapp_send_add(iapp, sta->addr, seq);
 
-       if (assoc && WLAN_FC_GET_STYPE(le_to_host16(assoc->frame_control)) ==
-           WLAN_FC_STYPE_REASSOC_REQ) {
-               /* IAPP-MOVE.request(MAC Address, Sequence Number, Old AP,
-                *                   Context Block, Timeout)
-                */
-               /* TODO: Send IAPP-MOVE to the old AP; Map Old AP BSSID to
-                * IP address */
-       }
+       /* TODO: If this was reassociation:
+        * IAPP-MOVE.request(MAC Address, Sequence Number, Old AP,
+        *                   Context Block, Timeout)
+        * TODO: Send IAPP-MOVE to the old AP; Map Old AP BSSID to
+        * IP address */
 }
 
 
index c97cef1307f36c74fc8ca1e05a905c88653ebaa8..14fb56758395c3406f7aa6fea9ef97fdee570f69 100644 (file)
@@ -1445,17 +1445,6 @@ static void handle_assoc(struct hostapd_data *hapd,
        }
 #endif /* CONFIG_IEEE80211W */
 
-       if (reassoc) {
-               os_memcpy(sta->previous_ap, mgmt->u.reassoc_req.current_ap,
-                         ETH_ALEN);
-       }
-
-       if (sta->last_assoc_req)
-               os_free(sta->last_assoc_req);
-       sta->last_assoc_req = os_malloc(len);
-       if (sta->last_assoc_req)
-               os_memcpy(sta->last_assoc_req, mgmt, len);
-
        /* Make sure that the previously registered inactivity timer will not
         * remove the STA immediately. */
        sta->timeout_next = STA_NULLFUNC;
@@ -1924,7 +1913,7 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
                status = le_to_host16(mgmt->u.assoc_resp.status_code);
 
        if (status != WLAN_STATUS_SUCCESS)
-               goto fail;
+               return;
 
        /* Stop previous accounting session, if one is started, and allocate
         * new session id for the new session. */
@@ -1986,7 +1975,7 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
                ap_sta_disconnect(hapd, sta, sta->addr,
                                  WLAN_REASON_DISASSOC_AP_BUSY);
 
-               goto fail;
+               return;
        }
 
        if (sta->flags & WLAN_STA_WDS) {
@@ -2006,11 +1995,11 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
                 * interface selection is not going to change anymore.
                 */
                if (ap_sta_bind_vlan(hapd, sta, 0) < 0)
-                       goto fail;
+                       return;
        } else if (sta->vlan_id) {
                /* VLAN ID already set (e.g., by PMKSA caching), so bind STA */
                if (ap_sta_bind_vlan(hapd, sta, 0) < 0)
-                       goto fail;
+                       return;
        }
 
        hostapd_set_sta_flags(hapd, sta);
@@ -2022,13 +2011,6 @@ static void handle_assoc_cb(struct hostapd_data *hapd,
        hapd->new_assoc_sta_cb(hapd, sta, !new_assoc);
 
        ieee802_1x_notify_port_enabled(sta->eapol_sm, 1);
-
- fail:
-       /* Copy of the association request is not needed anymore */
-       if (sta->last_assoc_req) {
-               os_free(sta->last_assoc_req);
-               sta->last_assoc_req = NULL;
-       }
 }
 
 
index c7d051be79be27cd7b63a91554dae9e4cfca7db6..f5417de0c62ac6350e9239fd739ab33ea42be7a9 100644 (file)
@@ -239,7 +239,6 @@ void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta)
                radius_client_flush_auth(hapd->radius, sta->addr);
 #endif /* CONFIG_NO_RADIUS */
 
-       os_free(sta->last_assoc_req);
        os_free(sta->challenge);
 
 #ifdef CONFIG_IEEE80211W
index c0bab6f256b5ad57433e8eafe0e29c7b7161f394..2dbdeb18181b4db848e60fa29ec7ca2a2f088e12 100644 (file)
@@ -61,7 +61,6 @@ struct sta_info {
        unsigned int hs20_deauth_requested:1;
 
        u16 auth_alg;
-       u8 previous_ap[6];
 
        enum {
                STA_NULLFUNC = 0, STA_DISASSOC, STA_DEAUTH, STA_REMOVE,
@@ -74,9 +73,6 @@ struct sta_info {
        /* IEEE 802.1X related data */
        struct eapol_state_machine *eapol_sm;
 
-       /* IEEE 802.11f (IAPP) related data */
-       struct ieee80211_mgmt *last_assoc_req;
-
        u32 acct_session_id_hi;
        u32 acct_session_id_lo;
        struct os_reltime acct_session_start;