]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Allow ENABLE_NETWORK to avoid automatic connection
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 16 Feb 2012 14:27:41 +0000 (16:27 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 16 Feb 2012 14:27:41 +0000 (16:27 +0200)
Extra parameter "no-connect" can now be added to the ENABLE_NETWORK
ctrl_iface command to avoid automatic connection to the enabled
network.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

wpa_supplicant/ctrl_iface.c
wpa_supplicant/wpa_cli.c

index 3602556b081086a8890eb93681c2ac935abf9e75..fda6eeb83f2dbde9ea177fcf411dbfd8f4e3a056 100644 (file)
@@ -1592,6 +1592,11 @@ static int wpa_supplicant_ctrl_iface_enable_network(
                                   "ENABLE_NETWORK with persistent P2P group");
                        return -1;
                }
+
+               if (os_strstr(cmd, " no-connect")) {
+                       ssid->disabled = 0;
+                       return 0;
+               }
        }
        wpa_supplicant_enable_network(wpa_s, ssid);
 
index af2e991187f0ceea2d12033201e2950f2b718751..ed269b2895163f42a7e954be9b08f09a1f784c57 100644 (file)
@@ -1464,7 +1464,12 @@ static int wpa_cli_cmd_enable_network(struct wpa_ctrl *ctrl, int argc,
                return -1;
        }
 
-       res = os_snprintf(cmd, sizeof(cmd), "ENABLE_NETWORK %s", argv[0]);
+       if (argc > 1)
+               res = os_snprintf(cmd, sizeof(cmd), "ENABLE_NETWORK %s %s",
+                                 argv[0], argv[1]);
+       else
+               res = os_snprintf(cmd, sizeof(cmd), "ENABLE_NETWORK %s",
+                                 argv[0]);
        if (res < 0 || (size_t) res >= sizeof(cmd))
                return -1;
        cmd[sizeof(cmd) - 1] = '\0';