hostapd: revert a broken upstream patch that was breaking multi-band operation
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>
This commit is contained in:
parent
e1d39bdbdb
commit
bb279e1a69
7 changed files with 107 additions and 30 deletions
|
@ -0,0 +1,77 @@
|
|||
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)
|
||||
{
|
|
@ -4,7 +4,7 @@ Subject: [PATCH] nl80211_del_beacon_bss.patch
|
|||
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -6403,8 +6403,7 @@ static void nl80211_teardown_ap(struct i
|
||||
@@ -6405,8 +6405,7 @@ static void nl80211_teardown_ap(struct i
|
||||
}
|
||||
|
||||
nl80211_put_wiphy_data_ap(bss);
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
void nl80211_remove_iface(struct wpa_driver_nl80211_data *drv, int ifidx);
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -753,6 +753,7 @@ struct wiphy_idx_data {
|
||||
@@ -755,6 +755,7 @@ struct wiphy_idx_data {
|
||||
enum nl80211_iftype nlmode;
|
||||
u8 *macaddr;
|
||||
u8 use_4addr;
|
||||
|
@ -27,7 +27,7 @@
|
|||
};
|
||||
|
||||
|
||||
@@ -778,6 +779,9 @@ static int netdev_info_handler(struct nl
|
||||
@@ -780,6 +781,9 @@ static int netdev_info_handler(struct nl
|
||||
if (tb[NL80211_ATTR_4ADDR])
|
||||
info->use_4addr = nla_get_u8(tb[NL80211_ATTR_4ADDR]);
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
|||
return NL_SKIP;
|
||||
}
|
||||
|
||||
@@ -844,6 +848,20 @@ static int nl80211_get_4addr(struct i802
|
||||
@@ -846,6 +850,20 @@ static int nl80211_get_4addr(struct i802
|
||||
}
|
||||
|
||||
|
||||
|
@ -58,7 +58,7 @@
|
|||
static int nl80211_register_beacons(struct wpa_driver_nl80211_data *drv,
|
||||
struct nl80211_wiphy_data *w)
|
||||
{
|
||||
@@ -6234,7 +6252,7 @@ const char * nl80211_iftype_str(enum nl8
|
||||
@@ -6236,7 +6254,7 @@ const char * nl80211_iftype_str(enum nl8
|
||||
static int nl80211_create_iface_once(struct wpa_driver_nl80211_data *drv,
|
||||
const char *ifname,
|
||||
enum nl80211_iftype iftype,
|
||||
|
@ -67,7 +67,7 @@
|
|||
int (*handler)(struct nl_msg *, void *),
|
||||
void *arg)
|
||||
{
|
||||
@@ -6254,6 +6272,10 @@ static int nl80211_create_iface_once(str
|
||||
@@ -6256,6 +6274,10 @@ static int nl80211_create_iface_once(str
|
||||
if (wds && nla_put_u8(msg, NL80211_ATTR_4ADDR, wds))
|
||||
goto fail;
|
||||
|
||||
|
@ -78,7 +78,7 @@
|
|||
/*
|
||||
* Tell cfg80211 that the interface belongs to the socket that created
|
||||
* it, and the interface should be deleted when the socket is closed.
|
||||
@@ -6309,14 +6331,14 @@ static int nl80211_create_iface_once(str
|
||||
@@ -6311,14 +6333,14 @@ static int nl80211_create_iface_once(str
|
||||
|
||||
int nl80211_create_iface(struct wpa_driver_nl80211_data *drv,
|
||||
const char *ifname, enum nl80211_iftype iftype,
|
||||
|
@ -96,7 +96,7 @@
|
|||
|
||||
/* if error occurred and interface exists already */
|
||||
if (ret < 0 && if_nametoindex(ifname)) {
|
||||
@@ -6342,7 +6364,7 @@ int nl80211_create_iface(struct wpa_driv
|
||||
@@ -6344,7 +6366,7 @@ int nl80211_create_iface(struct wpa_driv
|
||||
|
||||
/* Try to create the interface again */
|
||||
ret = nl80211_create_iface_once(drv, ifname, iftype, addr,
|
||||
|
@ -105,7 +105,7 @@
|
|||
}
|
||||
|
||||
if (ret >= 0 && is_p2p_net_interface(iftype)) {
|
||||
@@ -8683,8 +8705,8 @@ static int i802_set_wds_sta(void *priv,
|
||||
@@ -8685,8 +8707,8 @@ static int i802_set_wds_sta(void *priv,
|
||||
if (!if_nametoindex(name)) {
|
||||
if (nl80211_create_iface(drv, name,
|
||||
NL80211_IFTYPE_AP_VLAN,
|
||||
|
@ -116,7 +116,7 @@
|
|||
return -1;
|
||||
|
||||
if (bridge_ifname)
|
||||
@@ -9055,7 +9077,8 @@ static int wpa_driver_nl80211_if_add(voi
|
||||
@@ -9057,7 +9079,8 @@ static int wpa_driver_nl80211_if_add(voi
|
||||
|
||||
os_memset(&p2pdev_info, 0, sizeof(p2pdev_info));
|
||||
ifidx = nl80211_create_iface(drv, ifname, nlmode, addr,
|
||||
|
@ -126,7 +126,7 @@
|
|||
&p2pdev_info, use_existing);
|
||||
if (!p2pdev_info.wdev_id_set || ifidx != 0) {
|
||||
wpa_printf(MSG_ERROR, "nl80211: Failed to create a P2P Device interface %s",
|
||||
@@ -9072,7 +9095,8 @@ static int wpa_driver_nl80211_if_add(voi
|
||||
@@ -9074,7 +9097,8 @@ static int wpa_driver_nl80211_if_add(voi
|
||||
(long long unsigned int) p2pdev_info.wdev_id);
|
||||
} else {
|
||||
ifidx = nl80211_create_iface(drv, ifname, nlmode, addr,
|
||||
|
@ -136,7 +136,7 @@
|
|||
if (use_existing && ifidx == -ENFILE) {
|
||||
added = 0;
|
||||
ifidx = if_nametoindex(ifname);
|
||||
@@ -9142,6 +9166,8 @@ static int wpa_driver_nl80211_if_add(voi
|
||||
@@ -9144,6 +9168,8 @@ static int wpa_driver_nl80211_if_add(voi
|
||||
new_bss->ctx = bss_ctx;
|
||||
new_bss->added_if = added;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ Tested-by: Simon Wunderlich <simon.wunderlich@openmesh.com>
|
|||
struct wpa_driver_set_key_params {
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -12361,6 +12361,18 @@ static int nl80211_put_mesh_id(struct nl
|
||||
@@ -12363,6 +12363,18 @@ static int nl80211_put_mesh_id(struct nl
|
||||
}
|
||||
|
||||
|
||||
|
@ -48,7 +48,7 @@ Tested-by: Simon Wunderlich <simon.wunderlich@openmesh.com>
|
|||
static int nl80211_put_mesh_config(struct nl_msg *msg,
|
||||
struct wpa_driver_mesh_bss_params *params)
|
||||
{
|
||||
@@ -12422,6 +12434,7 @@ static int nl80211_join_mesh(struct i802
|
||||
@@ -12424,6 +12436,7 @@ static int nl80211_join_mesh(struct i802
|
||||
nl80211_put_basic_rates(msg, params->basic_rates) ||
|
||||
nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) ||
|
||||
nl80211_put_beacon_int(msg, params->beacon_int) ||
|
||||
|
|
|
@ -293,7 +293,7 @@ as adding/removing interfaces.
|
|||
|
||||
static struct nl_sock * nl_create_handle(struct nl_cb *cb, const char *dbg)
|
||||
{
|
||||
@@ -435,6 +445,11 @@ static int no_seq_check(struct nl_msg *m
|
||||
@@ -437,6 +447,11 @@ static int no_seq_check(struct nl_msg *m
|
||||
return NL_OK;
|
||||
}
|
||||
|
||||
|
@ -305,7 +305,7 @@ as adding/removing interfaces.
|
|||
|
||||
static void nl80211_nlmsg_clear(struct nl_msg *msg)
|
||||
{
|
||||
@@ -509,6 +524,8 @@ int send_and_recv_glb(struct nl80211_glo
|
||||
@@ -511,6 +526,8 @@ int send_and_recv_glb(struct nl80211_glo
|
||||
if (!msg)
|
||||
return -ENOMEM;
|
||||
|
||||
|
@ -314,7 +314,7 @@ as adding/removing interfaces.
|
|||
err.err = -ENOMEM;
|
||||
|
||||
s_nl_cb = nl_socket_get_cb(nl_handle);
|
||||
@@ -550,6 +567,7 @@ int send_and_recv_glb(struct nl80211_glo
|
||||
@@ -552,6 +569,7 @@ int send_and_recv_glb(struct nl80211_glo
|
||||
err.err_info = err_info;
|
||||
err.drv = drv;
|
||||
|
||||
|
@ -322,7 +322,7 @@ as adding/removing interfaces.
|
|||
nl_cb_err(cb, NL_CB_CUSTOM, error_handler, &err);
|
||||
nl_cb_set(cb, NL_CB_FINISH, NL_CB_CUSTOM, finish_handler, &err.err);
|
||||
if (ack_handler_custom) {
|
||||
@@ -971,6 +989,7 @@ nl80211_get_wiphy_data_ap(struct i802_bs
|
||||
@@ -973,6 +991,7 @@ nl80211_get_wiphy_data_ap(struct i802_bs
|
||||
os_free(w);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -330,7 +330,7 @@ as adding/removing interfaces.
|
|||
nl_cb_set(w->nl_cb, NL_CB_SEQ_CHECK, NL_CB_CUSTOM,
|
||||
no_seq_check, NULL);
|
||||
nl_cb_set(w->nl_cb, NL_CB_VALID, NL_CB_CUSTOM,
|
||||
@@ -1399,7 +1418,7 @@ static void wpa_driver_nl80211_event_rtm
|
||||
@@ -1401,7 +1420,7 @@ static void wpa_driver_nl80211_event_rtm
|
||||
}
|
||||
wpa_printf(MSG_DEBUG, "nl80211: Interface down (%s/%s)",
|
||||
namebuf, ifname);
|
||||
|
@ -339,7 +339,7 @@ as adding/removing interfaces.
|
|||
wpa_printf(MSG_DEBUG,
|
||||
"nl80211: Not the main interface (%s) - do not indicate interface down",
|
||||
drv->first_bss->ifname);
|
||||
@@ -1435,7 +1454,7 @@ static void wpa_driver_nl80211_event_rtm
|
||||
@@ -1437,7 +1456,7 @@ static void wpa_driver_nl80211_event_rtm
|
||||
}
|
||||
wpa_printf(MSG_DEBUG, "nl80211: Interface up (%s/%s)",
|
||||
namebuf, ifname);
|
||||
|
@ -348,7 +348,7 @@ as adding/removing interfaces.
|
|||
wpa_printf(MSG_DEBUG,
|
||||
"nl80211: Not the main interface (%s) - do not indicate interface up",
|
||||
drv->first_bss->ifname);
|
||||
@@ -2128,6 +2147,7 @@ static int wpa_driver_nl80211_init_nl_gl
|
||||
@@ -2130,6 +2149,7 @@ static int wpa_driver_nl80211_init_nl_gl
|
||||
genl_family_put(family);
|
||||
nl_cache_free(cache);
|
||||
|
||||
|
@ -356,7 +356,7 @@ as adding/removing interfaces.
|
|||
nl_cb_set(global->nl_cb, NL_CB_SEQ_CHECK, NL_CB_CUSTOM,
|
||||
no_seq_check, NULL);
|
||||
nl_cb_set(global->nl_cb, NL_CB_VALID, NL_CB_CUSTOM,
|
||||
@@ -2298,6 +2318,7 @@ static int nl80211_init_bss(struct i802_
|
||||
@@ -2300,6 +2320,7 @@ static int nl80211_init_bss(struct i802_
|
||||
if (!bss->nl_cb)
|
||||
return -1;
|
||||
|
||||
|
@ -364,7 +364,7 @@ as adding/removing interfaces.
|
|||
nl_cb_set(bss->nl_cb, NL_CB_SEQ_CHECK, NL_CB_CUSTOM,
|
||||
no_seq_check, NULL);
|
||||
nl_cb_set(bss->nl_cb, NL_CB_VALID, NL_CB_CUSTOM,
|
||||
@@ -8849,6 +8870,7 @@ static void *i802_init(struct hostapd_da
|
||||
@@ -8851,6 +8872,7 @@ static void *i802_init(struct hostapd_da
|
||||
char master_ifname[IFNAMSIZ];
|
||||
int ifindex, br_ifindex = 0;
|
||||
int br_added = 0;
|
||||
|
@ -372,7 +372,7 @@ as adding/removing interfaces.
|
|||
|
||||
bss = wpa_driver_nl80211_drv_init(hapd, params->ifname,
|
||||
params->global_priv, 1,
|
||||
@@ -8909,21 +8931,17 @@ static void *i802_init(struct hostapd_da
|
||||
@@ -8911,21 +8933,17 @@ static void *i802_init(struct hostapd_da
|
||||
(params->num_bridge == 0 || !params->bridge[0]))
|
||||
add_ifidx(drv, br_ifindex, drv->ifindex);
|
||||
|
||||
|
@ -404,7 +404,7 @@ as adding/removing interfaces.
|
|||
}
|
||||
|
||||
if (drv->capa.flags2 & WPA_DRIVER_FLAGS2_CONTROL_PORT_RX) {
|
||||
@@ -9302,6 +9320,50 @@ static int wpa_driver_nl80211_if_remove(
|
||||
@@ -9304,6 +9322,50 @@ static int wpa_driver_nl80211_if_remove(
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -455,7 +455,7 @@ as adding/removing interfaces.
|
|||
|
||||
static int cookie_handler(struct nl_msg *msg, void *arg)
|
||||
{
|
||||
@@ -11180,6 +11242,37 @@ static bool nl80211_is_drv_shared(void *
|
||||
@@ -11182,6 +11244,37 @@ static bool nl80211_is_drv_shared(void *
|
||||
#endif /* CONFIG_IEEE80211BE */
|
||||
|
||||
|
||||
|
@ -493,7 +493,7 @@ as adding/removing interfaces.
|
|||
static int driver_nl80211_send_mlme(void *priv, const u8 *data,
|
||||
size_t data_len, int noack,
|
||||
unsigned int freq,
|
||||
@@ -14999,6 +15092,8 @@ const struct wpa_driver_ops wpa_driver_n
|
||||
@@ -15001,6 +15094,8 @@ const struct wpa_driver_ops wpa_driver_n
|
||||
.set_acl = wpa_driver_nl80211_set_acl,
|
||||
.if_add = wpa_driver_nl80211_if_add,
|
||||
.if_remove = driver_nl80211_if_remove,
|
||||
|
|
|
@ -123,7 +123,7 @@ untagged DHCP packets
|
|||
* get_wowlan - Get wake-on-wireless status
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -12881,7 +12881,7 @@ static const char * drv_br_net_param_str
|
||||
@@ -12883,7 +12883,7 @@ static const char * drv_br_net_param_str
|
||||
|
||||
|
||||
static int wpa_driver_br_set_net_param(void *priv, enum drv_br_net_param param,
|
||||
|
@ -132,7 +132,7 @@ untagged DHCP packets
|
|||
{
|
||||
struct i802_bss *bss = priv;
|
||||
char path[128];
|
||||
@@ -12907,8 +12907,11 @@ static int wpa_driver_br_set_net_param(v
|
||||
@@ -12909,8 +12909,11 @@ static int wpa_driver_br_set_net_param(v
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
|
@ -429,7 +429,7 @@ Hotfix-by: Sebastian Gottschall https://github.com/mirror/dd-wrt/commit/0c3001a6
|
|||
* send_action - Transmit an Action frame
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -8701,25 +8701,15 @@ int nl80211_has_ifidx(struct wpa_driver_
|
||||
@@ -8703,25 +8703,15 @@ static int have_ifidx(struct wpa_driver_
|
||||
|
||||
|
||||
static int i802_set_wds_sta(void *priv, const u8 *addr, int aid, int val,
|
||||
|
|
Loading…
Reference in a new issue