wpa_cli: Allow global interface to be used in interactive mode

This is mostly a corner case at this point, but if wpa_cli was started
with global control interface connection (-g) and interactive mode,
per-interface control interface was tried to be opened with the
previously opened global ctrl_iface connection gettign leaked.

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2013-05-18 11:40:23 +03:00
parent 2925756575
commit 6fd5ceaf70

View file

@ -3330,6 +3330,9 @@ static void update_bssid_list(struct wpa_ctrl *ctrl)
static void try_connection(void *eloop_ctx, void *timeout_ctx) static void try_connection(void *eloop_ctx, void *timeout_ctx)
{ {
if (ctrl_conn)
goto done;
if (ctrl_ifname == NULL) if (ctrl_ifname == NULL)
ctrl_ifname = wpa_cli_get_default_ifname(); ctrl_ifname = wpa_cli_get_default_ifname();
@ -3348,6 +3351,7 @@ static void try_connection(void *eloop_ctx, void *timeout_ctx)
if (warning_displayed) if (warning_displayed)
printf("Connection established.\n"); printf("Connection established.\n");
done:
start_edit(); start_edit();
} }