commit 5bfbdd5a01ad05eef54ac41dcdc2104d93ab4bf8
parent c146490567830c01fde0f82d847c51adb3259448
Author: Denis Kenzior <denkenz@gmail.com>
Date: Thu, 15 Nov 2018 11:31:39 -0600
network: Check Autoconnectable as the first condition
Diffstat:
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/network.c b/src/network.c
@@ -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;