diff --git a/modules/hostap/src/supp_api.c b/modules/hostap/src/supp_api.c index 1bd8edb857c8..0469f3f952c4 100644 --- a/modules/hostap/src/supp_api.c +++ b/modules/hostap/src/supp_api.c @@ -1045,14 +1045,14 @@ static int wpas_add_and_config_network(struct wpa_supplicant *wpa_s, } } - if (params->security == WIFI_SECURITY_TYPE_SAE_H2E || - params->security == WIFI_SECURITY_TYPE_SAE_AUTO) { - if (!wpa_cli_cmd_v("set sae_pwe %d", - (params->security == WIFI_SECURITY_TYPE_SAE_H2E) - ? 1 - : 2)) { - goto out; - } + + if (!wpa_cli_cmd_v("set sae_pwe %d", + (params->security == WIFI_SECURITY_TYPE_SAE_H2E) + ? 1 + : ((params->security == WIFI_SECURITY_TYPE_SAE_AUTO) + ? 2 + : 0))) { + goto out; } if (!wpa_cli_cmd_v("set_network %d key_mgmt SAE%s", resp.network_id,