nl80211 events were propagated to the wrong interfaces
Fixes: 2ac791e87d
("hostapd: update to version 2025-06-27")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
77 lines
2.8 KiB
Diff
77 lines
2.8 KiB
Diff
From: Felix Fietkau <nbd@nbd.name>
|
|
Date: Sun, 6 Jul 2025 18:41:52 +0200
|
|
Subject: [PATCH] Revert "nl80211: Accept a global nl80211 event to a bridged
|
|
interface"
|
|
|
|
This reverts commit 1c994da117ad795766270cf04bc923971e27412f.
|
|
---
|
|
|
|
--- a/src/drivers/driver_nl80211_event.c
|
|
+++ b/src/drivers/driver_nl80211_event.c
|
|
@@ -4482,8 +4482,6 @@ int process_global_event(struct nl_msg *
|
|
wiphy_idx = nl80211_get_wiphy_index(bss);
|
|
if ((ifidx == -1 && !wiphy_idx_set && !wdev_id_set) ||
|
|
ifidx == bss->ifindex ||
|
|
- (bss->br_ifindex > 0 &&
|
|
- nl80211_has_ifidx(drv, bss->br_ifindex, ifidx)) ||
|
|
(wiphy_idx_set && wiphy_idx == wiphy_idx_rx) ||
|
|
(wdev_id_set && bss->wdev_id_set &&
|
|
wdev_id == bss->wdev_id)) {
|
|
--- a/src/drivers/driver_nl80211.c
|
|
+++ b/src/drivers/driver_nl80211.c
|
|
@@ -182,6 +182,8 @@ static void add_ifidx(struct wpa_driver_
|
|
int ifidx_reason);
|
|
static void del_ifidx(struct wpa_driver_nl80211_data *drv, int ifidx,
|
|
int ifidx_reason);
|
|
+static int have_ifidx(struct wpa_driver_nl80211_data *drv, int ifidx,
|
|
+ int ifidx_reason);
|
|
|
|
static int nl80211_set_channel(struct i802_bss *bss,
|
|
struct hostapd_freq_params *freq, int set_chan);
|
|
@@ -1270,7 +1272,7 @@ nl80211_find_drv(struct nl80211_global *
|
|
*init_failed = 1;
|
|
return drv;
|
|
}
|
|
- if (res > 0 || nl80211_has_ifidx(drv, idx, IFIDX_ANY))
|
|
+ if (res > 0 || have_ifidx(drv, idx, IFIDX_ANY))
|
|
return drv;
|
|
}
|
|
return NULL;
|
|
@@ -8583,7 +8585,7 @@ static void add_ifidx(struct wpa_driver_
|
|
wpa_printf(MSG_DEBUG,
|
|
"nl80211: Add own interface ifindex %d (ifidx_reason %d)",
|
|
ifidx, ifidx_reason);
|
|
- if (nl80211_has_ifidx(drv, ifidx, ifidx_reason)) {
|
|
+ if (have_ifidx(drv, ifidx, ifidx_reason)) {
|
|
wpa_printf(MSG_DEBUG, "nl80211: ifindex %d already in the list",
|
|
ifidx);
|
|
return;
|
|
@@ -8643,7 +8645,7 @@ static void del_ifidx(struct wpa_driver_
|
|
}
|
|
|
|
|
|
-int nl80211_has_ifidx(struct wpa_driver_nl80211_data *drv, int ifidx,
|
|
+static int have_ifidx(struct wpa_driver_nl80211_data *drv, int ifidx,
|
|
int ifidx_reason)
|
|
{
|
|
int i;
|
|
@@ -8750,7 +8752,7 @@ static void handle_eapol(int sock, void
|
|
return;
|
|
}
|
|
|
|
- if (nl80211_has_ifidx(drv, lladdr.sll_ifindex, IFIDX_ANY)) {
|
|
+ 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);
|
|
}
|
|
--- a/src/drivers/driver_nl80211.h
|
|
+++ b/src/drivers/driver_nl80211.h
|
|
@@ -371,8 +371,6 @@ struct i802_link * nl80211_get_link(stru
|
|
u8 nl80211_get_link_id_from_link(struct i802_bss *bss, struct i802_link *link);
|
|
int nl80211_remove_link(struct i802_bss *bss, int link_id);
|
|
void nl80211_update_active_links(struct i802_bss *bss, int link_id);
|
|
-int nl80211_has_ifidx(struct wpa_driver_nl80211_data *drv, int ifidx,
|
|
- int ifidx_reason);
|
|
|
|
static inline bool nl80211_link_valid(u16 links, s8 link_id)
|
|
{
|