3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2025-01-03 10:32:33 +01:00

network: Check Autoconnectable as the first condition

This commit is contained in:
Denis Kenzior 2018-11-15 11:31:39 -06:00
parent c146490567
commit 5bfbdd5a01

View File

@ -535,6 +535,15 @@ int network_autoconnect(struct network *network, struct scan_bss *bss)
if (!network_settings_load(network))
return -ENOKEY;
/* If no entry, default to Autoconnectable=True */
if (!l_settings_get_bool(network->settings, "Settings",
"Autoconnect", &is_autoconnectable))
is_autoconnectable = true;
ret = -EPERM;
if (!is_autoconnectable)
goto close_settings;
if (is_rsn) {
struct ie_rsn_info rsn;
@ -555,15 +564,6 @@ int network_autoconnect(struct network *network, struct scan_bss *bss)
}
}
/* If no entry, default to Autoconnectable=True */
if (!l_settings_get_bool(network->settings, "Settings",
"Autoconnect", &is_autoconnectable))
is_autoconnectable = true;
ret = -EPERM;
if (!is_autoconnectable)
goto close_settings;
if (security == SECURITY_8021X) {
struct l_queue *missing_secrets = NULL;