void hostapd_mgmt_tx_cb(struct hostapd_data *hapd, u8 *buf, size_t len,
u16 stype, int ok);
void hostapd_michael_mic_failure(struct hostapd_data *hapd, const u8 *addr);
+struct hostapd_data * hostapd_sta_get_bss(struct hostapd_data *hapd,
+ const u8 *addr);
#endif /* HOSTAPD_DRIVER_H */
static void handle_eapol(int sock, void *eloop_ctx, void *sock_ctx)
{
struct i802_driver_data *drv = eloop_ctx;
- struct hostapd_data *hapd = drv->hapd;
struct sockaddr_ll lladdr;
unsigned char buf[3000];
int len;
return;
}
- if (have_ifidx(drv, lladdr.sll_ifindex))
+ if (have_ifidx(drv, lladdr.sll_ifindex)) {
+ struct hostapd_data *hapd;
+ hapd = hostapd_sta_get_bss(drv->hapd, lladdr.sll_addr);
+ if (!hapd)
+ return;
hostapd_eapol_receive(hapd, lladdr.sll_addr, buf, len);
+ }
}
{
michael_mic_failure(hapd, addr, 1);
}
+
+
+struct hostapd_data * hostapd_sta_get_bss(struct hostapd_data *hapd,
+ const u8 *addr)
+{
+ struct hostapd_iface *iface = hapd->iface;
+ size_t j;
+
+ for (j = 0; j < iface->num_bss; j++) {
+ hapd = iface->bss[j];
+ if (ap_get_sta(hapd, addr))
+ return hapd;
+ }
+
+ return NULL;
+}