aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-04-03 18:03:13 (GMT)
committerJouni Malinen <j@w1.fi>2010-04-04 05:14:18 (GMT)
commitc41a1095b5c41d11e143b63e4babbf1753cf74fc (patch)
treea1fe3727839cffd713c9fa5364c339cd91acb9a7
parent0823031750afbf4ea087a86d73c095fb99ea4d0c (diff)
downloadhostap-c41a1095b5c41d11e143b63e4babbf1753cf74fc.zip
hostap-c41a1095b5c41d11e143b63e4babbf1753cf74fc.tar.gz
hostap-c41a1095b5c41d11e143b63e4babbf1753cf74fc.tar.bz2
Allow hostapd_notif_assoc() to be called with all IEs
This makes the call simpler for driver wrappers since there is no need to parse the IEs anymore before indicating association. In addition, this allows association processing to be extended to use other IEs in the future.
-rw-r--r--src/ap/drv_callbacks.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
index 61ca690..0fa6f73 100644
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
@@ -18,6 +18,7 @@
#include "radius/radius.h"
#include "drivers/driver.h"
#include "common/ieee802_11_defs.h"
+#include "common/ieee802_11_common.h"
#include "hostapd.h"
#include "ieee802_11.h"
#include "sta_info.h"
@@ -36,10 +37,31 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
{
struct sta_info *sta;
int new_assoc, res;
+ struct ieee802_11_elems elems;
hostapd_logger(hapd, addr, HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_INFO, "associated");
+ ieee802_11_parse_elems(ie, ielen, &elems, 0);
+ if (elems.wps_ie) {
+ ie = elems.wps_ie - 2;
+ ielen = elems.wps_ie_len + 2;
+ wpa_printf(MSG_DEBUG, "STA included WPS IE in (Re)AssocReq");
+ } else if (elems.rsn_ie) {
+ ie = elems.rsn_ie - 2;
+ ielen = elems.rsn_ie_len + 2;
+ wpa_printf(MSG_DEBUG, "STA included RSN IE in (Re)AssocReq");
+ } else if (elems.wpa_ie) {
+ ie = elems.wpa_ie - 2;
+ ielen = elems.wpa_ie_len + 2;
+ wpa_printf(MSG_DEBUG, "STA included WPA IE in (Re)AssocReq");
+ } else {
+ ie = NULL;
+ ielen = 0;
+ wpa_printf(MSG_DEBUG, "STA did not include WPS/RSN/WPA IE in "
+ "(Re)AssocReq");
+ }
+
sta = ap_get_sta(hapd, addr);
if (sta) {
accounting_sta_stop(hapd, sta);