From 1afbe801a5f1fa2dee532048b594a41a393bcc9a Mon Sep 17 00:00:00 2001 From: Chenming Huang Date: Tue, 15 Apr 2025 17:50:20 +0530 Subject: [PATCH] nl80211: Fix EAPOL RX handling in wrong BSS With commit 00c2c20d74ee ("hostapd: Maintain single wpa_driver_nl80211_data (drv) object across interfaces"), EAPOL frame reception is always handled by the first bss of wpa_driver_nl80211_data (drv). Issue is seen when OWE Transition mode is enabled and a peer connects in OWE BSS (the second BSS) but recieved EAPOL frames are wrongly handled in the open BSS (the first BSS). Iterate all BSSs to handle EAPOL frame reception to fix that. Fixes: 00c2c20d74ee ("hostapd: Maintain single wpa_driver_nl80211_data (drv) object across interfaces") Signed-off-by: Chenming Huang --- src/drivers/driver_nl80211.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index b264da7c3..2cff5bba0 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -8667,6 +8667,7 @@ static int i802_set_wds_sta(void *priv, const u8 *addr, int aid, int val, static void handle_eapol(int sock, void *eloop_ctx, void *sock_ctx) { struct wpa_driver_nl80211_data *drv = eloop_ctx; + struct i802_bss *bss; struct sockaddr_ll lladdr; unsigned char buf[3000]; int len; @@ -8680,8 +8681,10 @@ static void handle_eapol(int sock, void *eloop_ctx, void *sock_ctx) return; } - if (have_ifidx(drv, lladdr.sll_ifindex, IFIDX_ANY)) - drv_event_eapol_rx(drv->ctx, lladdr.sll_addr, buf, len); + if (have_ifidx(drv, lladdr.sll_ifindex, IFIDX_ANY)) { + for (bss = drv->first_bss; bss; bss = bss->next) + drv_event_eapol_rx(bss->ctx, lladdr.sll_addr, buf, len); + } } -- 2.47.2