hostapd: fix OWE ssid update on configuration changes

Refresh OWE transition IEs on updating BSS interfaces

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau 2024-09-18 18:26:45 +02:00
parent 81a48e7d1a
commit df1011e0b7
5 changed files with 50 additions and 3 deletions

View File

@ -0,0 +1,26 @@
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -2420,7 +2420,11 @@ static int hostapd_owe_iface_iter(struct
if (!bss->conf->ssid.ssid_set || !bss->conf->ssid.ssid_len ||
is_zero_ether_addr(bss->own_addr))
continue;
-
+ if (!os_memcmp(hapd->conf->owe_transition_bssid, bss->own_addr, ETH_ALEN) &&
+ hapd->conf->owe_transition_ssid_len == bss->conf->ssid.ssid_len &&
+ !os_memcmp(hapd->conf->owe_transition_ssid, bss->conf->ssid.ssid,
+ bss->conf->ssid.ssid_len))
+ return 0;
os_memcpy(hapd->conf->owe_transition_bssid, bss->own_addr,
ETH_ALEN);
os_memcpy(hapd->conf->owe_transition_ssid,
@@ -2437,10 +2441,6 @@ static int hostapd_owe_iface_iter(struct
int hostapd_owe_trans_get_info(struct hostapd_data *hapd)
{
- if (hapd->conf->owe_transition_ssid_len > 0 &&
- !is_zero_ether_addr(hapd->conf->owe_transition_bssid))
- return 0;
-
/* Find transition mode SSID/BSSID information from a BSS operated by
* this hostapd instance. */
if (!hapd->iface->interfaces ||

View File

@ -148,6 +148,15 @@ as adding/removing interfaces.
if (conf->wmm_enabled < 0)
conf->wmm_enabled = hapd->iconf->ieee80211n |
hapd->iconf->ieee80211ax;
@@ -2487,7 +2493,7 @@ static int hostapd_owe_iface_iter2(struc
#endif /* CONFIG_OWE */
-static void hostapd_owe_update_trans(struct hostapd_iface *iface)
+void hostapd_owe_update_trans(struct hostapd_iface *iface)
{
#ifdef CONFIG_OWE
/* Check whether the enabled BSS can complete OWE transition mode
@@ -2954,7 +2960,7 @@ hostapd_alloc_bss_data(struct hostapd_if
}
@ -213,6 +222,14 @@ as adding/removing interfaces.
void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
int reassoc);
void hostapd_interface_deinit_free(struct hostapd_iface *iface);
@@ -815,6 +824,7 @@ hostapd_switch_channel_fallback(struct h
void hostapd_cleanup_cs_params(struct hostapd_data *hapd);
void hostapd_periodic_iface(struct hostapd_iface *iface);
int hostapd_owe_trans_get_info(struct hostapd_data *hapd);
+void hostapd_owe_update_trans(struct hostapd_iface *iface);;
void hostapd_ocv_check_csa_sa_query(void *eloop_ctx, void *timeout_ctx);
void hostapd_switch_color(struct hostapd_data *hapd, u64 bitmap);
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -3928,6 +3928,25 @@ struct wpa_driver_ops {

View File

@ -79,9 +79,9 @@ full device, e.g. in order to deal with hardware/driver limitations
{
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -825,6 +825,7 @@ void hostapd_cleanup_cs_params(struct ho
void hostapd_periodic_iface(struct hostapd_iface *iface);
@@ -826,6 +826,7 @@ void hostapd_periodic_iface(struct hosta
int hostapd_owe_trans_get_info(struct hostapd_data *hapd);
void hostapd_owe_update_trans(struct hostapd_iface *iface);;
void hostapd_ocv_check_csa_sa_query(void *eloop_ctx, void *timeout_ctx);
+int hostapd_check_max_sta(struct hostapd_data *hapd);

View File

@ -29,7 +29,7 @@ a VLAN interface on top of the bridge, instead of using the bridge directly
int bridge_hairpin; /* hairpin_mode on bridge members */
--- a/src/ap/wpa_auth_glue.c
+++ b/src/ap/wpa_auth_glue.c
@@ -1815,8 +1815,12 @@ int hostapd_setup_wpa(struct hostapd_dat
@@ -1821,8 +1821,12 @@ int hostapd_setup_wpa(struct hostapd_dat
wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt)) {
const char *ft_iface;

View File

@ -259,6 +259,7 @@ uc_hostapd_bss_set_config(uc_vm_t *vm, size_t nargs)
hostapd_setup_bss(hapd, hapd == iface->bss[0], true);
hostapd_ucode_update_interfaces();
hostapd_owe_update_trans(iface);
done:
ret = 0;
@ -379,6 +380,7 @@ uc_hostapd_iface_add_bss(uc_vm_t *vm, size_t nargs)
conf->bss[idx] = NULL;
ret = hostapd_ucode_bss_get_uval(hapd);
hostapd_ucode_update_interfaces();
hostapd_owe_update_trans(iface);
goto out;
deinit_ctrl:
@ -607,6 +609,7 @@ out:
ieee802_11_set_beacon(hapd);
}
hostapd_owe_update_trans(iface);
return ucv_boolean_new(true);
}
@ -698,6 +701,7 @@ uc_hostapd_bss_rename(uc_vm_t *vm, size_t nargs)
hostapd_ubus_add_bss(hapd);
hostapd_ucode_update_interfaces();
hostapd_owe_update_trans(hapd->iface);
out:
if (interfaces->ctrl_iface_init)
interfaces->ctrl_iface_init(hapd);