aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2011-02-08 12:32:35 (GMT)
committerJouni Malinen <j@w1.fi>2011-02-08 12:32:35 (GMT)
commite67b55fb11fde405a0bbeeb4c33abf0d1b6dc7c2 (patch)
tree79320cf89cbe2e50b83bb2910d826181fb18d324 /src
parentd601247ca9b1dff6bb97e6d8608bf32f54e6d98a (diff)
downloadhostap-e67b55fb11fde405a0bbeeb4c33abf0d1b6dc7c2.zip
hostap-e67b55fb11fde405a0bbeeb4c33abf0d1b6dc7c2.tar.gz
hostap-e67b55fb11fde405a0bbeeb4c33abf0d1b6dc7c2.tar.bz2
wpa_s AP: Deliver EVENT_RX_PROBE_REQ events to AP processing
This is needed to allows WPS PBC session overlap detection to work with drivers that process Probe Request frames internally. This code is is run in hostapd, but the wpa_supplicant AP mode did not have call to the hostapd_probe_req_rx() function even though it registered handlers for hostapd Probe Request RX callbacks.
Diffstat (limited to 'src')
-rw-r--r--src/ap/drv_callbacks.c38
-rw-r--r--src/ap/hostapd.h2
2 files changed, 21 insertions, 19 deletions
diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
index c1fdba6..c1557a1 100644
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
@@ -247,6 +247,25 @@ void hostapd_event_sta_low_ack(struct hostapd_data *hapd, const u8 *addr)
}
+int hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa,
+ const u8 *ie, size_t ie_len)
+{
+ size_t i;
+ int ret = 0;
+
+ if (sa)
+ random_add_randomness(sa, ETH_ALEN);
+ for (i = 0; hapd->probereq_cb && i < hapd->num_probereq_cb; i++) {
+ if (hapd->probereq_cb[i].cb(hapd->probereq_cb[i].ctx,
+ sa, ie, ie_len) > 0) {
+ ret = 1;
+ break;
+ }
+ }
+ return ret;
+}
+
+
#ifdef HOSTAPD
#ifdef NEED_AP_MLME
@@ -386,25 +405,6 @@ static void hostapd_mgmt_tx_cb(struct hostapd_data *hapd, const u8 *buf,
#endif /* NEED_AP_MLME */
-static int hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa,
- const u8 *ie, size_t ie_len)
-{
- size_t i;
- int ret = 0;
-
- if (sa)
- random_add_randomness(sa, ETH_ALEN);
- for (i = 0; hapd->probereq_cb && i < hapd->num_probereq_cb; i++) {
- if (hapd->probereq_cb[i].cb(hapd->probereq_cb[i].ctx,
- sa, ie, ie_len) > 0) {
- ret = 1;
- break;
- }
- }
- return ret;
-}
-
-
static int hostapd_event_new_sta(struct hostapd_data *hapd, const u8 *addr)
{
struct sta_info *sta = ap_get_sta(hapd, addr);
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
index 8d2dc20..470bfe9 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -252,5 +252,7 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
const u8 *ie, size_t ielen);
void hostapd_notif_disassoc(struct hostapd_data *hapd, const u8 *addr);
void hostapd_event_sta_low_ack(struct hostapd_data *hapd, const u8 *addr);
+int hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa,
+ const u8 *ie, size_t ie_len);
#endif /* HOSTAPD_H */