ie_len = len - (IEEE80211_HDRLEN + sizeof(mgmt->u.probe_req));
for (i = 0; hapd->probereq_cb && i < hapd->num_probereq_cb; i++)
- hapd->probereq_cb[i].cb(hapd->probereq_cb[i].ctx,
- mgmt->sa, ie, ie_len);
+ if (hapd->probereq_cb[i].cb(hapd->probereq_cb[i].ctx,
+ mgmt->sa, ie, ie_len) > 0)
+ return;
if (!hapd->iconf->send_probe_response)
return;
#endif /* HOSTAPD */
-void hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa,
+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;
- for (i = 0; hapd->probereq_cb && i < hapd->num_probereq_cb; i++)
- hapd->probereq_cb[i].cb(hapd->probereq_cb[i].ctx,
- sa, ie, ie_len);
+ 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;
}
struct full_dynamic_vlan;
struct hostapd_probereq_cb {
- void (*cb)(void *ctx, const u8 *sa, const u8 *ie, size_t ie_len);
+ int (*cb)(void *ctx, const u8 *sa, const u8 *ie, size_t ie_len);
void *ctx;
};
/* utils.c */
int hostapd_register_probereq_cb(struct hostapd_data *hapd,
- void (*cb)(void *ctx, const u8 *sa,
- const u8 *ie, size_t ie_len),
+ int (*cb)(void *ctx, const u8 *sa,
+ const u8 *ie, size_t ie_len),
void *ctx);
void hostapd_prune_associations(struct hostapd_data *hapd, const u8 *addr);
int hostapd_register_probereq_cb(struct hostapd_data *hapd,
- void (*cb)(void *ctx, const u8 *sa,
- const u8 *ie, size_t ie_len),
+ int (*cb)(void *ctx, const u8 *sa,
+ const u8 *ie, size_t ie_len),
void *ctx)
{
struct hostapd_probereq_cb *n;
static void hostapd_wps_upnp_deinit(struct hostapd_data *hapd);
#endif /* CONFIG_WPS_UPNP */
-static void hostapd_wps_probe_req_rx(void *ctx, const u8 *addr,
- const u8 *ie, size_t ie_len);
+static int hostapd_wps_probe_req_rx(void *ctx, const u8 *addr,
+ const u8 *ie, size_t ie_len);
static int hostapd_wps_new_psk_cb(void *ctx, const u8 *mac_addr, const u8 *psk,
#endif /* CONFIG_WPS_OOB */
-static void hostapd_wps_probe_req_rx(void *ctx, const u8 *addr,
- const u8 *ie, size_t ie_len)
+static int hostapd_wps_probe_req_rx(void *ctx, const u8 *addr,
+ const u8 *ie, size_t ie_len)
{
struct hostapd_data *hapd = ctx;
struct wpabuf *wps_ie;
if (hapd->wps == NULL)
- return;
+ return 0;
wps_ie = ieee802_11_vendor_ie_concat(ie, ie_len, WPS_DEV_OUI_WFA);
if (wps_ie == NULL)
- return;
+ return 0;
if (wpabuf_len(wps_ie) > 0) {
wps_registrar_probe_req_rx(hapd->wps->registrar, addr, wps_ie);
}
wpabuf_free(wps_ie);
+
+ return 0;
}
struct hostapd_data * hostapd_sta_get_bss(struct hostapd_data *hapd,
const u8 *addr);
-void hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa,
- const u8 *ie, size_t ie_len);
+int hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa,
+ const u8 *ie, size_t ie_len);
#endif /* DRIVER_H */