]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_cli: Go through ifname determination on connection retries
authorJouni Malinen <j@w1.fi>
Sun, 5 Aug 2012 19:04:22 +0000 (22:04 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 5 Aug 2012 19:04:22 +0000 (22:04 +0300)
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 <j@w1.fi>

wpa_supplicant/wpa_cli.c

index 85fd79ca94485e31915189e9cd33e5906ed3a983..ba624761c7fd6ecfc95a6d1be861a2cf6fb79ef3 100644 (file)
@@ -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: "