mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 18:28:23 -05:00
nl80211: Fix EAPOL frame RX for secondary BSSes
Need to figure out which BSS should process the frame based on the source address (STA/Supplicant MAC address).
This commit is contained in:
parent
6143f11705
commit
f82ef4d8db
@ -237,5 +237,7 @@ void hostapd_mgmt_rx(struct hostapd_data *hapd, u8 *buf, size_t len,
|
||||
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 */
|
||||
|
@ -1731,7 +1731,6 @@ static void handle_frame(struct i802_driver_data *drv,
|
||||
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;
|
||||
@ -1744,8 +1743,13 @@ static void handle_eapol(int sock, void *eloop_ctx, void *sock_ctx)
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -278,3 +278,19 @@ void hostapd_michael_mic_failure(struct hostapd_data *hapd, const u8 *addr)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user