ipq807x/hostapd: merge missing e-mspk sta/psk index patch

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2025-03-24 10:47:05 +01:00
parent 82ae3766fa
commit 5a597c912d

View File

@@ -694,7 +694,7 @@
if (vlan_id)
*vlan_id = 0;
if (psk_len)
@@ -381,13 +382,18 @@ static const u8 * hostapd_wpa_auth_get_p
@@ -381,12 +382,17 @@ static const u8 * hostapd_wpa_auth_get_p
* returned psk which should not be returned again.
* logic list (all hostapd_get_psk; all sta->psk)
*/
@@ -702,28 +702,26 @@
+ psk = NULL;
if (sta && sta->psk && !psk) {
struct hostapd_sta_wpa_psk_short *pos;
+ int psk_idx;
+ int psk_idx = 1;
if (vlan_id)
*vlan_id = 0;
psk = sta->psk->psk;
+ sta->psk_idx = psk_idx = 1;
+ if (vlan_id)
+ sta->psk_idx = psk_idx;
for (pos = sta->psk; pos; pos = pos->next) {
+ psk_idx++;
if (pos->is_passphrase) {
pbkdf2_sha1(pos->passphrase,
hapd->conf->ssid.ssid,
@@ -396,10 +402,14 @@ static const u8 * hostapd_wpa_auth_get_p
pos->is_passphrase = 0;
@@ -397,9 +403,13 @@ static const u8 * hostapd_wpa_auth_get_p
}
if (pos->psk == prev_psk) {
+ sta->psk_idx = psk_idx;
psk = pos->next ? pos->next->psk : NULL;
+ if (vlan_id)
+ sta->psk_idx = psk_idx + 1;
break;
}
}
+
+ if (!psk)
+ if (vlan_id && !psk)
+ sta->psk_idx = 0;
}
return psk;