4d9574b9e9154b0b41917cd722f368825a4cc199
[openwrt/staging/ldir.git] /
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Sun, 6 Jul 2025 18:41:52 +0200
3 Subject: [PATCH] Revert "nl80211: Accept a global nl80211 event to a bridged
4 interface"
5
6 This reverts commit 1c994da117ad795766270cf04bc923971e27412f.
7 ---
8
9 --- a/src/drivers/driver_nl80211_event.c
10 +++ b/src/drivers/driver_nl80211_event.c
11 @@ -4482,8 +4482,6 @@ int process_global_event(struct nl_msg *
12 wiphy_idx = nl80211_get_wiphy_index(bss);
13 if ((ifidx == -1 && !wiphy_idx_set && !wdev_id_set) ||
14 ifidx == bss->ifindex ||
15 - (bss->br_ifindex > 0 &&
16 - nl80211_has_ifidx(drv, bss->br_ifindex, ifidx)) ||
17 (wiphy_idx_set && wiphy_idx == wiphy_idx_rx) ||
18 (wdev_id_set && bss->wdev_id_set &&
19 wdev_id == bss->wdev_id)) {
20 --- a/src/drivers/driver_nl80211.c
21 +++ b/src/drivers/driver_nl80211.c
22 @@ -182,6 +182,8 @@ static void add_ifidx(struct wpa_driver_
23 int ifidx_reason);
24 static void del_ifidx(struct wpa_driver_nl80211_data *drv, int ifidx,
25 int ifidx_reason);
26 +static int have_ifidx(struct wpa_driver_nl80211_data *drv, int ifidx,
27 + int ifidx_reason);
28
29 static int nl80211_set_channel(struct i802_bss *bss,
30 struct hostapd_freq_params *freq, int set_chan);
31 @@ -1270,7 +1272,7 @@ nl80211_find_drv(struct nl80211_global *
32 *init_failed = 1;
33 return drv;
34 }
35 - if (res > 0 || nl80211_has_ifidx(drv, idx, IFIDX_ANY))
36 + if (res > 0 || have_ifidx(drv, idx, IFIDX_ANY))
37 return drv;
38 }
39 return NULL;
40 @@ -8583,7 +8585,7 @@ static void add_ifidx(struct wpa_driver_
41 wpa_printf(MSG_DEBUG,
42 "nl80211: Add own interface ifindex %d (ifidx_reason %d)",
43 ifidx, ifidx_reason);
44 - if (nl80211_has_ifidx(drv, ifidx, ifidx_reason)) {
45 + if (have_ifidx(drv, ifidx, ifidx_reason)) {
46 wpa_printf(MSG_DEBUG, "nl80211: ifindex %d already in the list",
47 ifidx);
48 return;
49 @@ -8643,7 +8645,7 @@ static void del_ifidx(struct wpa_driver_
50 }
51
52
53 -int nl80211_has_ifidx(struct wpa_driver_nl80211_data *drv, int ifidx,
54 +static int have_ifidx(struct wpa_driver_nl80211_data *drv, int ifidx,
55 int ifidx_reason)
56 {
57 int i;
58 @@ -8750,7 +8752,7 @@ static void handle_eapol(int sock, void
59 return;
60 }
61
62 - if (nl80211_has_ifidx(drv, lladdr.sll_ifindex, IFIDX_ANY)) {
63 + if (have_ifidx(drv, lladdr.sll_ifindex, IFIDX_ANY)) {
64 for (bss = drv->first_bss; bss; bss = bss->next)
65 drv_event_eapol_rx(bss->ctx, lladdr.sll_addr, buf, len);
66 }
67 --- a/src/drivers/driver_nl80211.h
68 +++ b/src/drivers/driver_nl80211.h
69 @@ -371,8 +371,6 @@ struct i802_link * nl80211_get_link(stru
70 u8 nl80211_get_link_id_from_link(struct i802_bss *bss, struct i802_link *link);
71 int nl80211_remove_link(struct i802_bss *bss, int link_id);
72 void nl80211_update_active_links(struct i802_bss *bss, int link_id);
73 -int nl80211_has_ifidx(struct wpa_driver_nl80211_data *drv, int ifidx,
74 - int ifidx_reason);
75
76 static inline bool nl80211_link_valid(u16 links, s8 link_id)
77 {