mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-07 10:48:12 +02:00
supplicant: don't set PMF when the supplicant doesn't support it
When the supplicant does not support PMF we wrongly set 'ieee80211w=0', but since the option is not recognized the connection fails. Don't set it when unsupported. Fixes:a9ab50efb1(cherry picked from commit58c4cd9cc9)
This commit is contained in:
parent
d0dd120ab4
commit
542e340f01
1 changed files with 6 additions and 3 deletions
|
|
@ -744,6 +744,7 @@ nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self,
|
||||||
NMSupplicantConfigPrivate *priv = NM_SUPPLICANT_CONFIG_GET_PRIVATE (self);
|
NMSupplicantConfigPrivate *priv = NM_SUPPLICANT_CONFIG_GET_PRIVATE (self);
|
||||||
const char *key_mgmt, *key_mgmt_conf, *auth_alg;
|
const char *key_mgmt, *key_mgmt_conf, *auth_alg;
|
||||||
const char *psk;
|
const char *psk;
|
||||||
|
gboolean set_pmf;
|
||||||
|
|
||||||
g_return_val_if_fail (NM_IS_SUPPLICANT_CONFIG (self), FALSE);
|
g_return_val_if_fail (NM_IS_SUPPLICANT_CONFIG (self), FALSE);
|
||||||
g_return_val_if_fail (setting != NULL, FALSE);
|
g_return_val_if_fail (setting != NULL, FALSE);
|
||||||
|
|
@ -831,13 +832,14 @@ nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self,
|
||||||
pmf = NM_SETTING_WIRELESS_SECURITY_PMF_DISABLE;
|
pmf = NM_SETTING_WIRELESS_SECURITY_PMF_DISABLE;
|
||||||
|
|
||||||
/* Check if we actually support PMF */
|
/* Check if we actually support PMF */
|
||||||
|
set_pmf = TRUE;
|
||||||
if (!priv->support_pmf) {
|
if (!priv->support_pmf) {
|
||||||
if (pmf == NM_SETTING_WIRELESS_SECURITY_PMF_REQUIRED) {
|
if (pmf == NM_SETTING_WIRELESS_SECURITY_PMF_REQUIRED) {
|
||||||
g_set_error_literal (error, NM_SUPPLICANT_ERROR, NM_SUPPLICANT_ERROR_CONFIG,
|
g_set_error_literal (error, NM_SUPPLICANT_ERROR, NM_SUPPLICANT_ERROR_CONFIG,
|
||||||
"Supplicant does not support PMF");
|
"Supplicant does not support PMF");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
} else if (pmf == NM_SETTING_WIRELESS_SECURITY_PMF_OPTIONAL)
|
}
|
||||||
pmf = NM_SETTING_WIRELESS_SECURITY_PMF_DISABLE;
|
set_pmf = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Only WPA-specific things when using WPA */
|
/* Only WPA-specific things when using WPA */
|
||||||
|
|
@ -851,7 +853,8 @@ nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self,
|
||||||
if (!ADD_STRING_LIST_VAL (self, setting, wireless_security, group, groups, "group", ' ', TRUE, NULL, error))
|
if (!ADD_STRING_LIST_VAL (self, setting, wireless_security, group, groups, "group", ' ', TRUE, NULL, error))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if ( !nm_streq (key_mgmt, "wpa-none")
|
if ( set_pmf
|
||||||
|
&& !nm_streq (key_mgmt, "wpa-none")
|
||||||
&& NM_IN_SET (pmf,
|
&& NM_IN_SET (pmf,
|
||||||
NM_SETTING_WIRELESS_SECURITY_PMF_DISABLE,
|
NM_SETTING_WIRELESS_SECURITY_PMF_DISABLE,
|
||||||
NM_SETTING_WIRELESS_SECURITY_PMF_REQUIRED)) {
|
NM_SETTING_WIRELESS_SECURITY_PMF_REQUIRED)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue