diff options
author | Jouni Malinen <jouni@qca.qualcomm.com> | 2012-02-16 16:27:41 +0200 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2012-02-16 16:27:41 +0200 |
commit | 84c78f9570a619885b04896acb3b094a70cb6e2d (patch) | |
tree | 173c3c0dfdf84e77fd321e2ee9753c0c8f0878d3 | |
parent | 8b9d0bfa004cba666c5995e5fe0a42556765e073 (diff) | |
download | external_wpa_supplicant_8_ti-84c78f9570a619885b04896acb3b094a70cb6e2d.zip external_wpa_supplicant_8_ti-84c78f9570a619885b04896acb3b094a70cb6e2d.tar.gz external_wpa_supplicant_8_ti-84c78f9570a619885b04896acb3b094a70cb6e2d.tar.bz2 |
Allow ENABLE_NETWORK to avoid automatic connection
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>
-rw-r--r-- | wpa_supplicant/ctrl_iface.c | 5 | ||||
-rw-r--r-- | wpa_supplicant/wpa_cli.c | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 3602556..fda6eeb 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -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); diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c index af2e991..ed269b2 100644 --- a/wpa_supplicant/wpa_cli.c +++ b/wpa_supplicant/wpa_cli.c @@ -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'; |