aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-04-02 13:49:50 (GMT)
committerJouni Malinen <j@w1.fi>2016-04-02 13:55:01 (GMT)
commite1b99620c929174e7b69a8b25f17ba31e1f1f31f (patch)
tree3ca826a442afca00166840952ce7d96e7576cb24
parent07f0da300352790fcd7af8a48c74b6cb2f150f92 (diff)
downloadhostap-e1b99620c929174e7b69a8b25f17ba31e1f1f31f.zip
hostap-e1b99620c929174e7b69a8b25f17ba31e1f1f31f.tar.gz
hostap-e1b99620c929174e7b69a8b25f17ba31e1f1f31f.tar.bz2
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>
-rw-r--r--src/ap/beacon.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ap/beacon.c b/src/ap/beacon.c
index 0720e14..19bff7b 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
@@ -685,12 +685,12 @@ void handle_probe_req(struct hostapd_data *hapd,
u16 csa_offs[2];
size_t csa_offs_len;
- ie = mgmt->u.probe_req.variable;
- if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.probe_req))
+ if (len < IEEE80211_HDRLEN)
return;
+ ie = ((const u8 *) mgmt) + IEEE80211_HDRLEN;
if (hapd->iconf->track_sta_max_num)
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++)
if (hapd->probereq_cb[i].cb(hapd->probereq_cb[i].ctx,