From 7e542f6a77aabfd02c82bef5240ce0a09ebf5070 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 22 Oct 2024 16:56:19 +0200 Subject: [PATCH] hostapd: fix build error with SAE disabled Fixes: b2a2c286170d ("hostapd: add support for authenticating with multiple PSKs via ubus helper") Signed-off-by: Felix Fietkau --- .../services/hostapd/patches/601-ucode_support.patch | 12 ++++++++---- ...0-Implement-APuP-Access-Point-Micro-Peering.patch | 6 +++--- .../patches/803-hostapd-fix-80211be-build.patch | 4 ++-- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/package/network/services/hostapd/patches/601-ucode_support.patch b/package/network/services/hostapd/patches/601-ucode_support.patch index a3c03bf3599d..5a88687cf222 100644 --- a/package/network/services/hostapd/patches/601-ucode_support.patch +++ b/package/network/services/hostapd/patches/601-ucode_support.patch @@ -725,7 +725,7 @@ as adding/removing interfaces. for (pw = hapd->conf->sae_passwords; pw; pw = pw->next) { if (!is_broadcast_ether_addr(pw->peer_addr) && (!sta || -@@ -582,12 +587,28 @@ const char * sae_get_password(struct hos +@@ -582,12 +587,30 @@ const char * sae_get_password(struct hos pt = hapd->conf->ssid.pt; } @@ -741,6 +741,7 @@ as adding/removing interfaces. + if (!sta->use_sta_psk) + break; + ++#ifdef CONFIG_SAE + if (sta->sae_pt) { + pt = sta->sae_pt; break; @@ -753,10 +754,11 @@ as adding/removing interfaces. + NULL); + sta->sae_pt = pt; + break; ++#endif } } -@@ -3229,6 +3250,12 @@ static void handle_auth(struct hostapd_d +@@ -3229,6 +3252,12 @@ static void handle_auth(struct hostapd_d goto fail; } @@ -771,17 +773,19 @@ as adding/removing interfaces. --- a/src/ap/sta_info.c +++ b/src/ap/sta_info.c -@@ -474,6 +474,9 @@ void ap_free_sta(struct hostapd_data *ha +@@ -474,6 +474,11 @@ void ap_free_sta(struct hostapd_data *ha forced_memzero(sta->last_tk, WPA_TK_MAX_LEN); #endif /* CONFIG_TESTING_OPTIONS */ ++#ifdef CONFIG_SAE + if (sta->sae_pt) + sae_deinit_pt(sta->sae_pt); ++#endif + os_free(sta); } -@@ -1507,6 +1510,8 @@ void ap_sta_set_authorized_event(struct +@@ -1507,6 +1512,8 @@ void ap_sta_set_authorized_event(struct #endif /* CONFIG_P2P */ const u8 *ip_ptr = NULL; diff --git a/package/network/services/hostapd/patches/780-Implement-APuP-Access-Point-Micro-Peering.patch b/package/network/services/hostapd/patches/780-Implement-APuP-Access-Point-Micro-Peering.patch index 157b7dbb8230..dae7ad180c91 100644 --- a/package/network/services/hostapd/patches/780-Implement-APuP-Access-Point-Micro-Peering.patch +++ b/package/network/services/hostapd/patches/780-Implement-APuP-Access-Point-Micro-Peering.patch @@ -372,7 +372,7 @@ Hotfix-by: Sebastian Gottschall https://github.com/mirror/dd-wrt/commit/0c3001a6 #ifdef CONFIG_FILS static struct wpabuf * -@@ -3615,8 +3618,8 @@ static u16 check_multi_ap(struct hostapd +@@ -3617,8 +3620,8 @@ static u16 check_multi_ap(struct hostapd } @@ -383,7 +383,7 @@ Hotfix-by: Sebastian Gottschall https://github.com/mirror/dd-wrt/commit/0c3001a6 { /* Supported rates not used in IEEE 802.11ad/DMG */ if (hapd->iface->current_mode && -@@ -4003,7 +4006,7 @@ static int __check_assoc_ies(struct host +@@ -4005,7 +4008,7 @@ static int __check_assoc_ies(struct host elems->ext_capab_len); if (resp != WLAN_STATUS_SUCCESS) return resp; @@ -392,7 +392,7 @@ Hotfix-by: Sebastian Gottschall https://github.com/mirror/dd-wrt/commit/0c3001a6 if (resp != WLAN_STATUS_SUCCESS) return resp; -@@ -6058,6 +6061,11 @@ static void handle_beacon(struct hostapd +@@ -6060,6 +6063,11 @@ static void handle_beacon(struct hostapd 0); ap_list_process_beacon(hapd->iface, mgmt, &elems, fi); diff --git a/package/network/services/hostapd/patches/803-hostapd-fix-80211be-build.patch b/package/network/services/hostapd/patches/803-hostapd-fix-80211be-build.patch index 55c6e635813c..cbd6298d9d36 100644 --- a/package/network/services/hostapd/patches/803-hostapd-fix-80211be-build.patch +++ b/package/network/services/hostapd/patches/803-hostapd-fix-80211be-build.patch @@ -1,6 +1,6 @@ --- a/src/ap/sta_info.c +++ b/src/ap/sta_info.c -@@ -1836,3 +1836,22 @@ void ap_sta_free_sta_profile(struct mld_ +@@ -1914,3 +1914,22 @@ void ap_sta_free_sta_profile(struct mld_ } } #endif /* CONFIG_IEEE80211BE */ @@ -25,7 +25,7 @@ + --- a/src/ap/sta_info.h +++ b/src/ap/sta_info.h -@@ -417,23 +417,8 @@ int ap_sta_re_add(struct hostapd_data *h +@@ -408,23 +408,8 @@ int ap_sta_re_add(struct hostapd_data *h void ap_free_sta_pasn(struct hostapd_data *hapd, struct sta_info *sta); -- 2.30.2