mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-05 02:10:17 +01:00
ifcfg-rh: drop unreachable code in make_wpa_setting()
This triggers a coverity warning because we above already check that not all relevant keys are NULL together. Work around warning by modifying the code.
This commit is contained in:
parent
2ea3c23723
commit
210d7eb528
1 changed files with 7 additions and 6 deletions
|
|
@ -3629,7 +3629,10 @@ make_wpa_setting (shvarFile *ifcfg,
|
|||
wpa_sae = nm_streq0 (v, "SAE");
|
||||
wpa_eap = nm_streq0 (v, "WPA-EAP");
|
||||
ieee8021x = nm_streq0 (v, "IEEE8021X");
|
||||
if (!wpa_psk && !wpa_sae && !wpa_eap && !ieee8021x)
|
||||
if ( !wpa_psk
|
||||
&& !wpa_sae
|
||||
&& !wpa_eap
|
||||
&& !ieee8021x)
|
||||
return NULL; /* Not WPA or Dynamic WEP */
|
||||
|
||||
/* WPS */
|
||||
|
|
@ -3693,7 +3696,9 @@ make_wpa_setting (shvarFile *ifcfg,
|
|||
g_object_set (wsec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "sae", NULL);
|
||||
else
|
||||
g_assert_not_reached ();
|
||||
} else if (wpa_eap || ieee8021x) {
|
||||
} else {
|
||||
nm_assert (wpa_eap || ieee8021x);
|
||||
|
||||
/* Adhoc mode is mutually exclusive with any 802.1x-based authentication */
|
||||
if (adhoc) {
|
||||
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
|
||||
|
|
@ -3710,10 +3715,6 @@ make_wpa_setting (shvarFile *ifcfg,
|
|||
|
||||
g_object_set (wsec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, lower, NULL);
|
||||
}
|
||||
} else {
|
||||
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
|
||||
"Unknown wireless KEY_MGMT type '%s'", v);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
i_val = NM_SETTING_WIRELESS_SECURITY_PMF_DEFAULT;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue