aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpa_cli.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-08-31 14:27:20 (GMT)
committerJouni Malinen <j@w1.fi>2013-08-31 14:27:20 (GMT)
commit02a3e5c0d130e6944dcf93998f3866a9c484eb36 (patch)
tree3c003d656c763d73a4d400ac95402b254b60b3b4 /wpa_supplicant/wpa_cli.c
parentcdf8bfa4346b0792b93418e2d14d0e558ce33d72 (diff)
downloadhostap-02a3e5c0d130e6944dcf93998f3866a9c484eb36.zip
hostap-02a3e5c0d130e6944dcf93998f3866a9c484eb36.tar.gz
hostap-02a3e5c0d130e6944dcf93998f3866a9c484eb36.tar.bz2
wpa_cli: Allow first DISCONNECTED event to be reported
wpa_cli filters out extra DISCONNECTED events from action scripts. This ended up filtering out the first real DISCONNECT event in case wpa_cli was started when wpa_supplicant was in connected state. Change wpa_cli to allow the first disconnection event to be reported to the action script in such case. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/wpa_cli.c')
-rw-r--r--wpa_supplicant/wpa_cli.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index 5e6643f..9c158eb 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -70,7 +70,7 @@ static struct wpa_ctrl *ctrl_conn;
static struct wpa_ctrl *mon_conn;
static int wpa_cli_quit = 0;
static int wpa_cli_attached = 0;
-static int wpa_cli_connected = 0;
+static int wpa_cli_connected = -1;
static int wpa_cli_last_id = 0;
#ifndef CONFIG_CTRL_IFACE_DIR
#define CONFIG_CTRL_IFACE_DIR "/var/run/wpa_supplicant"
@@ -3053,7 +3053,7 @@ static void wpa_cli_action_process(const char *msg)
os_setenv("WPA_CTRL_DIR", ctrl_iface_dir, 1);
- if (!wpa_cli_connected || new_id != wpa_cli_last_id) {
+ if (wpa_cli_connected <= 0 || new_id != wpa_cli_last_id) {
wpa_cli_connected = 1;
wpa_cli_last_id = new_id;
wpa_cli_exec(action_file, ctrl_ifname, "CONNECTED");