hostapd: fix sta psk index for dynamic psk auth
authorFelix Fietkau <nbd@nbd.name>
Wed, 12 Feb 2025 10:54:59 +0000 (11:54 +0100)
committerFelix Fietkau <nbd@nbd.name>
Wed, 12 Feb 2025 11:00:19 +0000 (12:00 +0100)
commitcb4d2b3fb2a85bcd2aa49c4d11732e5b55e458c5
tree55cb18a59a702e78d49e52c89a339da9d5cf0f48
parent7955545469688cbb228b8c5f3bdc519d12c2e8d5
hostapd: fix sta psk index for dynamic psk auth

Depending on the config / circumstances, the get_psk call can be called
multiple times from differnt places, which can lead to wrong sta->psk_idx
values. The correct call is the one that is also interested in the vlan_id,
so use the vlan_id pointer as indication of when to set sta->psk_idx.
Also fix off-by-one error for secondary PSKs

Fixes: b2a2c286170d ("hostapd: add support for authenticating with multiple PSKs via ubus helper")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 8118b2dace06de839e1e23f018059995f4af5e11)
package/network/services/hostapd/patches/601-ucode_support.patch
package/network/services/hostapd/patches/730-ft_iface.patch
package/network/services/hostapd/patches/803-hostapd-fix-80211be-build.patch