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
3 changed files with 24 additions and 2 deletions
|
@ -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,
|
void hostapd_mgmt_tx_cb(struct hostapd_data *hapd, u8 *buf, size_t len,
|
||||||
u16 stype, int ok);
|
u16 stype, int ok);
|
||||||
void hostapd_michael_mic_failure(struct hostapd_data *hapd, const u8 *addr);
|
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 */
|
#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)
|
static void handle_eapol(int sock, void *eloop_ctx, void *sock_ctx)
|
||||||
{
|
{
|
||||||
struct i802_driver_data *drv = eloop_ctx;
|
struct i802_driver_data *drv = eloop_ctx;
|
||||||
struct hostapd_data *hapd = drv->hapd;
|
|
||||||
struct sockaddr_ll lladdr;
|
struct sockaddr_ll lladdr;
|
||||||
unsigned char buf[3000];
|
unsigned char buf[3000];
|
||||||
int len;
|
int len;
|
||||||
|
@ -1744,9 +1743,14 @@ static void handle_eapol(int sock, void *eloop_ctx, void *sock_ctx)
|
||||||
return;
|
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);
|
hostapd_eapol_receive(hapd, lladdr.sll_addr, buf, len);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void handle_monitor_read(int sock, void *eloop_ctx, void *sock_ctx)
|
static void handle_monitor_read(int sock, void *eloop_ctx, void *sock_ctx)
|
||||||
|
|
|
@ -278,3 +278,19 @@ void hostapd_michael_mic_failure(struct hostapd_data *hapd, const u8 *addr)
|
||||||
{
|
{
|
||||||
michael_mic_failure(hapd, addr, 1);
|
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 a new issue