]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
hostapd: add association frame to taxonomy data
authorJohn Crispin <john@phrozen.org>
Tue, 29 Jul 2025 12:20:19 +0000 (14:20 +0200)
committerFelix Fietkau <nbd@nbd.name>
Mon, 26 Jan 2026 17:46:16 +0000 (17:46 +0000)
Extend the taxonomy subsystem to capture the complete association frame
in addition to the existing probe and association IE data.

This adds a new assoc_frame_taxonomy field to struct sta_info and exposes
it via the get_sta_ies ubus method as a base64-encoded "assoc_frame" field.

Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/services/hostapd/patches/600-ubus_support.patch
package/network/services/hostapd/patches/780-Implement-APuP-Access-Point-Micro-Peering.patch
package/network/services/hostapd/patches/803-hostapd-fix-80211be-build.patch
package/network/services/hostapd/src/src/ap/ubus.c

index 0c132b9d277a877e07b44a29ed083dcda91aab09..25f0a504b2494149cae9afb0624d0dd621c47771 100644 (file)
@@ -251,7 +251,15 @@ probe/assoc/auth requests via object subscribe.
  
        /* followed by SSID and Supported rates; and HT capabilities if 802.11n
         * is used */
-@@ -6073,6 +6090,13 @@ static void handle_assoc(struct hostapd_
+@@ -6057,6 +6074,7 @@ static void handle_assoc(struct hostapd_
+ #ifdef CONFIG_TAXONOMY
+       taxonomy_sta_info_assoc_req(hapd, sta, pos, left);
++      taxonomy_sta_info_assoc_frame(hapd, sta, mgmt, len);
+ #endif /* CONFIG_TAXONOMY */
+       sta->pending_wds_enable = 0;
+@@ -6073,6 +6091,13 @@ static void handle_assoc(struct hostapd_
        if (set_beacon)
                ieee802_11_update_beacons(hapd->iface);
  
@@ -265,7 +273,7 @@ probe/assoc/auth requests via object subscribe.
   fail:
  
        /*
-@@ -6302,6 +6326,7 @@ static void handle_disassoc(struct hosta
+@@ -6302,6 +6327,7 @@ static void handle_disassoc(struct hosta
                           (unsigned long) len);
                return;
        }
@@ -273,7 +281,7 @@ probe/assoc/auth requests via object subscribe.
  
        sta = ap_get_sta(hapd, mgmt->sa);
        if (!sta) {
-@@ -6333,6 +6358,8 @@ static void handle_deauth(struct hostapd
+@@ -6333,6 +6359,8 @@ static void handle_deauth(struct hostapd
        /* Clear the PTKSA cache entries for PASN */
        ptksa_cache_flush(hapd->ptksa, mgmt->sa, WPA_CIPHER_NONE);
  
@@ -392,7 +400,15 @@ probe/assoc/auth requests via object subscribe.
                    hapd->msg_ctx_parent != hapd->msg_ctx)
 --- a/src/ap/sta_info.h
 +++ b/src/ap/sta_info.h
-@@ -302,6 +302,7 @@ struct sta_info {
+@@ -255,6 +255,7 @@ struct sta_info {
+ #ifdef CONFIG_TAXONOMY
+       struct wpabuf *probe_ie_taxonomy;
+       struct wpabuf *assoc_ie_taxonomy;
++      struct wpabuf *assoc_frame_taxonomy;
+ #endif /* CONFIG_TAXONOMY */
+ #ifdef CONFIG_FILS
+@@ -302,6 +303,7 @@ struct sta_info {
  #endif /* CONFIG_TESTING_OPTIONS */
  #ifdef CONFIG_AIRTIME_POLICY
        unsigned int airtime_weight;
@@ -657,3 +673,31 @@ probe/assoc/auth requests via object subscribe.
                case 'o':
                        params.override_driver = optarg;
                        break;
+--- a/src/ap/taxonomy.c
++++ b/src/ap/taxonomy.c
+@@ -290,3 +290,12 @@ void taxonomy_sta_info_assoc_req(const s
+       wpabuf_free(sta->assoc_ie_taxonomy);
+       sta->assoc_ie_taxonomy = wpabuf_alloc_copy(ie, ie_len);
+ }
++
++void taxonomy_sta_info_assoc_frame(const struct hostapd_data *hapd,
++                                 struct sta_info *sta,
++                                 const struct ieee80211_mgmt *mgmt,
++                                 size_t len)
++{
++      wpabuf_free(sta->assoc_frame_taxonomy);
++      sta->assoc_frame_taxonomy = wpabuf_alloc_copy(mgmt, len);
++}
+--- a/src/ap/taxonomy.h
++++ b/src/ap/taxonomy.h
+@@ -18,6 +18,10 @@ void taxonomy_hostapd_sta_info_probe_req
+ void taxonomy_sta_info_assoc_req(const struct hostapd_data *hapd,
+                                struct sta_info *sta,
+                                const u8 *ie, size_t ie_len);
++void taxonomy_sta_info_assoc_frame(const struct hostapd_data *hapd,
++                                 struct sta_info *sta,
++                                 const struct ieee80211_mgmt *mgmt,
++                                 size_t len);
+ int retrieve_sta_taxonomy(const struct hostapd_data *hapd,
+                         struct sta_info *sta, char *buf, size_t buflen);
index 514ffaf509ff82d704b74db32e94f5d845e1e5df..d0c2e67ccf84421962c30eceb204d2e29bfa450e 100644 (file)
@@ -393,7 +393,7 @@ Hotfix-by: Sebastian Gottschall https://github.com/mirror/dd-wrt/commit/0c3001a6
        if (resp != WLAN_STATUS_SUCCESS)
                return resp;
  
-@@ -6422,6 +6425,11 @@ static void handle_beacon(struct hostapd
+@@ -6423,6 +6426,11 @@ static void handle_beacon(struct hostapd
                                      0);
  
        ap_list_process_beacon(hapd->iface, mgmt, &elems, fi);
index 78034fbb806ce5ec3f16d13185010918aca69a4a..2a4ec0b75543cc8fd494dd949962a6ce4078b486 100644 (file)
@@ -25,7 +25,7 @@
 +
 --- a/src/ap/sta_info.h
 +++ b/src/ap/sta_info.h
-@@ -412,23 +412,8 @@ int ap_sta_re_add(struct hostapd_data *h
+@@ -413,23 +413,8 @@ int ap_sta_re_add(struct hostapd_data *h
  
  void ap_free_sta_pasn(struct hostapd_data *hapd, struct sta_info *sta);
  
index 5e562b62c93bb07d925b4c48cf47f8d6105460a1..ff0ea312df1684d84c5066edf740744edaca476b 100644 (file)
@@ -1623,12 +1623,13 @@ hostapd_bss_get_sta_ies(struct ubus_context *ctx, struct ubus_object *obj,
                return UBUS_STATUS_INVALID_ARGUMENT;
 
        sta = ap_get_sta(hapd, addr);
-       if (!sta || (!sta->probe_ie_taxonomy && !sta->assoc_ie_taxonomy))
+       if (!sta || (!sta->probe_ie_taxonomy && !sta->assoc_ie_taxonomy && !sta->assoc_frame_taxonomy))
                return UBUS_STATUS_NOT_FOUND;
 
        blob_buf_init(&b, 0);
        hostapd_add_b64_data("probe_ie", sta->probe_ie_taxonomy);
        hostapd_add_b64_data("assoc_ie", sta->assoc_ie_taxonomy);
+       hostapd_add_b64_data("assoc_frame", sta->assoc_frame_taxonomy);
        ubus_send_reply(ctx, req, b.head);
 
        return 0;