]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Send BEACON-REQ-TX-STATUS event only for beacon reports
authorJouni Malinen <j@w1.fi>
Sat, 7 Jan 2017 20:23:13 +0000 (22:23 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 7 Jan 2017 20:23:13 +0000 (22:23 +0200)
Check the action TX status callback contents more thoroughly and report
the BEACON-REQ-TX-STATUS event only if the Measurement Type indicates
beacon report.

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

index 09850ef089d283f2a8c0437e0e86752e1ce9ba3d..fdc2bac3c4db9838e69e42b54ed5949a7d196188 100644 (file)
@@ -3409,6 +3409,7 @@ static void handle_action_cb(struct hostapd_data *hapd,
                             size_t len, int ok)
 {
        struct sta_info *sta;
+       const struct rrm_measurement_report_element *report;
 
        if (is_multicast_ether_addr(mgmt->da))
                return;
@@ -3419,10 +3420,15 @@ static void handle_action_cb(struct hostapd_data *hapd,
                return;
        }
 
-       if (len < 24 + 2)
+       if (len < 24 + 5 + sizeof(*report))
                return;
+       report = (const struct rrm_measurement_report_element *)
+               &mgmt->u.action.u.rrm.variable[2];
        if (mgmt->u.action.category == WLAN_ACTION_RADIO_MEASUREMENT &&
-           mgmt->u.action.u.rrm.action == WLAN_RRM_RADIO_MEASUREMENT_REQUEST)
+           mgmt->u.action.u.rrm.action == WLAN_RRM_RADIO_MEASUREMENT_REQUEST &&
+           report->eid == WLAN_EID_MEASURE_REQUEST &&
+           report->len >= 3 &&
+           report->type == MEASURE_TYPE_BEACON)
                hostapd_rrm_beacon_req_tx_status(hapd, mgmt, len, ok);
 }