mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 18:28:23 -05:00
AP: Do not use struct ieee80211_mgmt::u.probe_req
This struct in the union is empty, but the design of using a zero-length u8 array here is not fully compatible with C++ and can result in undesired compiler warnings. Since there are no non-IE fields in the Probe Request frames, get the location of the variable length IEs simply by using the pointer to the frame header and the known header length. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
07f0da3003
commit
e1b99620c9
@ -685,12 +685,12 @@ void handle_probe_req(struct hostapd_data *hapd,
|
|||||||
u16 csa_offs[2];
|
u16 csa_offs[2];
|
||||||
size_t csa_offs_len;
|
size_t csa_offs_len;
|
||||||
|
|
||||||
ie = mgmt->u.probe_req.variable;
|
if (len < IEEE80211_HDRLEN)
|
||||||
if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.probe_req))
|
|
||||||
return;
|
return;
|
||||||
|
ie = ((const u8 *) mgmt) + IEEE80211_HDRLEN;
|
||||||
if (hapd->iconf->track_sta_max_num)
|
if (hapd->iconf->track_sta_max_num)
|
||||||
sta_track_add(hapd->iface, mgmt->sa);
|
sta_track_add(hapd->iface, mgmt->sa);
|
||||||
ie_len = len - (IEEE80211_HDRLEN + sizeof(mgmt->u.probe_req));
|
ie_len = len - IEEE80211_HDRLEN;
|
||||||
|
|
||||||
for (i = 0; hapd->probereq_cb && i < hapd->num_probereq_cb; i++)
|
for (i = 0; hapd->probereq_cb && i < hapd->num_probereq_cb; i++)
|
||||||
if (hapd->probereq_cb[i].cb(hapd->probereq_cb[i].ctx,
|
if (hapd->probereq_cb[i].cb(hapd->probereq_cb[i].ctx,
|
||||||
|
Loading…
Reference in New Issue
Block a user