Skip to content

Commit

Permalink
hostapd: fix OWE ssid update on configuration changes
Browse files Browse the repository at this point in the history
Refresh OWE transition IEs on updating BSS interfaces

Signed-off-by: Felix Fietkau <[email protected]>
  • Loading branch information
nbd168 committed Sep 21, 2024
1 parent 81a48e7 commit df1011e
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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 ||
17 changes: 17 additions & 0 deletions package/network/services/hostapd/patches/601-ucode_support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 4 additions & 0 deletions package/network/services/hostapd/src/src/ap/ucode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -607,6 +609,7 @@ uc_hostapd_iface_start(uc_vm_t *vm, size_t nargs)

ieee802_11_set_beacon(hapd);
}
hostapd_owe_update_trans(iface);

return ucv_boolean_new(true);
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit df1011e

Please sign in to comment.