]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_cli: Fix an issue in the cleanup of udp-remote commits
authorJouni Malinen <j@w1.fi>
Sun, 5 Aug 2012 18:54:56 +0000 (21:54 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 5 Aug 2012 18:54:56 +0000 (21:54 +0300)
wpa_ctrl_get_remote_ifname() is defined only for UDP ctrl_iface socket,
so this call needs to be made conditional on build parameters.

Signed-hostap: Jouni Malinen <j@w1.fi>

wpa_supplicant/wpa_cli.c

index b4ec65f7b98d743cca43ba2cbb0b1e23ff3be1f0..85fd79ca94485e31915189e9cd33e5906ed3a983 100644 (file)
@@ -3806,6 +3806,11 @@ static int edit_started = 0;
 static void start_edit(void)
 {
        char *home;
+       char *ps = NULL;
+
+#ifdef CONFIG_CTRL_IFACE_UDP_REMOTE
+       ps = wpa_ctrl_get_remote_ifname(ctrl_conn);
+#endif /* CONFIG_CTRL_IFACE_UDP_REMOTE */
 
        home = getenv("HOME");
        if (home) {
@@ -3817,8 +3822,7 @@ static void start_edit(void)
        }
 
        if (edit_init(wpa_cli_edit_cmd_cb, wpa_cli_edit_eof_cb,
-                     wpa_cli_edit_completion_cb, NULL, hfile,
-                     wpa_ctrl_get_remote_ifname(ctrl_conn)) < 0) {
+                     wpa_cli_edit_completion_cb, NULL, hfile, ps) < 0) {
                eloop_terminate();
                return;
        }