aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest/rx_mgmt.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-11-06 16:10:34 (GMT)
committerJouni Malinen <j@w1.fi>2010-11-07 21:29:01 (GMT)
commit021a6fe49954768221f025d644851579b1aa6c6c (patch)
treed3c7246252dff247017ad6542361275bc2cdf16a /wlantest/rx_mgmt.c
parent2d73f0a875df46d03c16c5e54d5c935cfdc2ee75 (diff)
downloadhostap-021a6fe49954768221f025d644851579b1aa6c6c.zip
hostap-021a6fe49954768221f025d644851579b1aa6c6c.tar.gz
hostap-021a6fe49954768221f025d644851579b1aa6c6c.tar.bz2
wlantest: Maintain a copy of WPA/RSN IE from (Re)AssocReq
Diffstat (limited to 'wlantest/rx_mgmt.c')
-rw-r--r--wlantest/rx_mgmt.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/wlantest/rx_mgmt.c b/wlantest/rx_mgmt.c
index 843c2b5..2100a8a 100644
--- a/wlantest/rx_mgmt.c
+++ b/wlantest/rx_mgmt.c
@@ -192,6 +192,7 @@ static void rx_mgmt_assoc_req(struct wlantest *wt, const u8 *data, size_t len)
const struct ieee80211_mgmt *mgmt;
struct wlantest_bss *bss;
struct wlantest_sta *sta;
+ struct ieee802_11_elems elems;
mgmt = (const struct ieee80211_mgmt *) data;
bss = bss_get(wt, mgmt->bssid);
@@ -212,6 +213,16 @@ static void rx_mgmt_assoc_req(struct wlantest *wt, const u8 *data, size_t len)
MAC2STR(mgmt->sa), MAC2STR(mgmt->da),
le_to_host16(mgmt->u.assoc_req.capab_info),
le_to_host16(mgmt->u.assoc_req.listen_interval));
+
+ if (ieee802_11_parse_elems(mgmt->u.assoc_req.variable,
+ len - (mgmt->u.assoc_req.variable - data),
+ &elems, 0) == ParseFailed) {
+ wpa_printf(MSG_INFO, "Invalid IEs in Association Request "
+ "frame from " MACSTR, MAC2STR(mgmt->sa));
+ return;
+ }
+
+ sta_update_assoc(sta, &elems);
}
@@ -275,6 +286,7 @@ static void rx_mgmt_reassoc_req(struct wlantest *wt, const u8 *data,
const struct ieee80211_mgmt *mgmt;
struct wlantest_bss *bss;
struct wlantest_sta *sta;
+ struct ieee802_11_elems elems;
mgmt = (const struct ieee80211_mgmt *) data;
bss = bss_get(wt, mgmt->bssid);
@@ -296,6 +308,16 @@ static void rx_mgmt_reassoc_req(struct wlantest *wt, const u8 *data,
le_to_host16(mgmt->u.reassoc_req.capab_info),
le_to_host16(mgmt->u.reassoc_req.listen_interval),
MAC2STR(mgmt->u.reassoc_req.current_ap));
+
+ if (ieee802_11_parse_elems(mgmt->u.reassoc_req.variable,
+ len - (mgmt->u.reassoc_req.variable - data),
+ &elems, 0) == ParseFailed) {
+ wpa_printf(MSG_INFO, "Invalid IEs in Reassociation Request "
+ "frame from " MACSTR, MAC2STR(mgmt->sa));
+ return;
+ }
+
+ sta_update_assoc(sta, &elems);
}