From: Jouni Malinen Date: Sun, 5 Aug 2012 19:04:22 +0000 (+0300) Subject: wpa_cli: Go through ifname determination on connection retries X-Git-Tag: hostap_2_0~481 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e897ae37b4db5ab4336e5c035fdb8b62e126b00;p=thirdparty%2Fhostap.git wpa_cli: Go through ifname determination on connection retries This is needed to allow the default behavior (pick first interface) to be used in cases where wpa_supplicant is not available when wpa_cli is started in interactive mode. Signed-hostap: Jouni Malinen --- diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c index 85fd79ca9..ba624761c 100644 --- a/wpa_supplicant/wpa_cli.c +++ b/wpa_supplicant/wpa_cli.c @@ -95,6 +95,7 @@ static DEFINE_DL_LIST(p2p_groups); /* struct cli_txt_entry */ static void print_help(void); static void wpa_cli_mon_receive(int sock, void *eloop_ctx, void *sock_ctx); static void wpa_cli_close_connection(void); +static char * wpa_cli_get_default_ifname(void); static void usage(void) @@ -3834,6 +3835,9 @@ static void start_edit(void) static void try_connection(void *eloop_ctx, void *timeout_ctx) { + if (ctrl_ifname == NULL) + ctrl_ifname = wpa_cli_get_default_ifname(); + if (!wpa_cli_open_connection(ctrl_ifname, 1) == 0) { if (!warning_displayed) { printf("Could not connect to wpa_supplicant: "