From 5bfbdd5a01ad05eef54ac41dcdc2104d93ab4bf8 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 15 Nov 2018 11:31:39 -0600 Subject: [PATCH] network: Check Autoconnectable as the first condition --- src/network.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/network.c b/src/network.c index cae1f1f9..a044221d 100644 --- 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;