wifi-scripts: don't fail on unset PSK
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run

Don't fail wireless interface bringup on empty PSK set. This is a valid
configuration, resulting in a PSK network which can't be connected to.
It does not fail the bringup of the hostapd process.

Keep failing the interface setup in case a password with invalid length
is used.

This is also beneficial when intending to configure a PPSK network. It
allows to create a network where no PPSK is yet set.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 17a71f0c15)
This commit is contained in:
David Bauer 2024-12-07 14:47:29 +01:00
parent 9f76cda378
commit 5289460fd0

View File

@ -697,7 +697,7 @@ hostapd_set_bss_options() {
append bss_conf "wpa_psk=$key" "$N" append bss_conf "wpa_psk=$key" "$N"
elif [ ${#key} -ge 8 ] && [ ${#key} -le 63 ]; then elif [ ${#key} -ge 8 ] && [ ${#key} -le 63 ]; then
append bss_conf "wpa_passphrase=$key" "$N" append bss_conf "wpa_passphrase=$key" "$N"
elif [ -n "$key" ] || [ -z "$wpa_psk_file" ]; then elif [ -n "$key" ]; then
wireless_setup_vif_failed INVALID_WPA_PSK wireless_setup_vif_failed INVALID_WPA_PSK
return 1 return 1
fi fi