taxonomy: Store Probe Request frames in hostapd_sta_info
[mech_eap.git] / src / ap / sta_info.c
index a8c0308..f12d408 100644 (file)
@@ -32,6 +32,7 @@
 #include "ap_drv_ops.h"
 #include "gas_serv.h"
 #include "wnm_ap.h"
+#include "mbo_ap.h"
 #include "ndisc_snoop.h"
 #include "sta_info.h"
 #include "vlan.h"
@@ -170,8 +171,10 @@ void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta)
        ap_sta_ip6addr_del(hapd, sta);
 
        if (!hapd->iface->driver_ap_teardown &&
-           !(sta->flags & WLAN_STA_PREAUTH))
+           !(sta->flags & WLAN_STA_PREAUTH)) {
                hostapd_drv_sta_remove(hapd, sta->addr);
+               sta->added_unassoc = 0;
+       }
 
        ap_sta_hash_del(hapd, sta);
        ap_sta_list_del(hapd, sta);
@@ -219,6 +222,13 @@ void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta)
                hapd->iface->num_sta_ht_20mhz--;
        }
 
+#ifdef CONFIG_TAXONOMY
+       wpabuf_free(sta->probe_ie_taxonomy);
+       sta->probe_ie_taxonomy = NULL;
+       wpabuf_free(sta->assoc_ie_taxonomy);
+       sta->assoc_ie_taxonomy = NULL;
+#endif /* CONFIG_TAXONOMY */
+
 #ifdef CONFIG_IEEE80211N
        ht40_intolerant_remove(hapd->iface, sta);
 #endif /* CONFIG_IEEE80211N */
@@ -275,8 +285,10 @@ void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta)
                 * VLAN.
                 */
                if (hapd->iface->driver_ap_teardown &&
-                   !(sta->flags & WLAN_STA_PREAUTH))
+                   !(sta->flags & WLAN_STA_PREAUTH)) {
                        hostapd_drv_sta_remove(hapd, sta->addr);
+                       sta->added_unassoc = 0;
+               }
                vlan_remove_dynamic(hapd, sta->vlan_id_bound);
        }
 #endif /* CONFIG_NO_VLAN */
@@ -322,6 +334,9 @@ void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta)
        os_free(sta->sae);
 #endif /* CONFIG_SAE */
 
+       mbo_ap_sta_free(sta);
+       os_free(sta->supp_op_classes);
+
        os_free(sta);
 }
 
@@ -652,6 +667,11 @@ struct sta_info * ap_sta_add(struct hostapd_data *hapd, const u8 *addr)
        sta->last_seq_ctrl = WLAN_INVALID_MGMT_SEQ;
        dl_list_init(&sta->ip6addr);
 
+#ifdef CONFIG_TAXONOMY
+       sta_track_claim_taxonomy_info(hapd->iface, addr,
+                                     &sta->probe_ie_taxonomy);
+#endif /* CONFIG_TAXONOMY */
+
        return sta;
 }
 
@@ -673,6 +693,7 @@ static int ap_sta_remove(struct hostapd_data *hapd, struct sta_info *sta)
                           hapd->conf->iface, MAC2STR(sta->addr));
                return -1;
        }
+       sta->added_unassoc = 0;
        return 0;
 }
 
@@ -895,8 +916,9 @@ int ap_sta_set_vlan(struct hostapd_data *hapd, struct sta_info *sta,
                                       HOSTAPD_MODULE_IEEE80211,
                                       HOSTAPD_LEVEL_DEBUG,
                                       "could not add dynamic VLAN interface for vlan=%d%s",
-                                      vlan_desc->untagged,
-                                      vlan_desc->tagged[0] ? "+" : "");
+                                      vlan_desc ? vlan_desc->untagged : -1,
+                                      (vlan_desc && vlan_desc->tagged[0]) ?
+                                      "+" : "");
                        vlan_id = 0;
                        ret = -1;
                        goto done;