aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-04-02 13:52:43 (GMT)
committerJouni Malinen <j@w1.fi>2016-04-02 13:55:02 (GMT)
commit094e9492659a5dd572fa2a399d7cfcb480ea51c6 (patch)
tree8a372e30553e6194e4ab0a9e9d56fff8cb1731dd
parentc01120a05fb696c8e38d73afe7ac0c6f67c508de (diff)
downloadhostap-094e9492659a5dd572fa2a399d7cfcb480ea51c6.zip
hostap-094e9492659a5dd572fa2a399d7cfcb480ea51c6.tar.gz
hostap-094e9492659a5dd572fa2a399d7cfcb480ea51c6.tar.bz2
atheros: 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/drivers/driver_atheros.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/drivers/driver_atheros.c b/src/drivers/driver_atheros.c
index a5a379e..ba3cad0 100644
--- a/src/drivers/driver_atheros.c
+++ b/src/drivers/driver_atheros.c
@@ -855,16 +855,15 @@ static void atheros_raw_receive(void *ctx, const u8 *src_addr, const u8 *buf,
(int) len);
if (stype == WLAN_FC_STYPE_PROBE_REQ) {
- if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.probe_req))
+ if (len < IEEE80211_HDRLEN)
return;
os_memset(&event, 0, sizeof(event));
event.rx_probe_req.sa = mgmt->sa;
event.rx_probe_req.da = mgmt->da;
event.rx_probe_req.bssid = mgmt->bssid;
- event.rx_probe_req.ie = mgmt->u.probe_req.variable;
- event.rx_probe_req.ie_len =
- len - (IEEE80211_HDRLEN + sizeof(mgmt->u.probe_req));
+ event.rx_probe_req.ie = buf + IEEE80211_HDRLEN;
+ event.rx_probe_req.ie_len = len - IEEE80211_HDRLEN;
wpa_supplicant_event(drv->hapd, EVENT_RX_PROBE_REQ, &event);
return;
}