diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h index efa85fa82..f1384b4a1 100644 --- a/src/common/wpa_ctrl.h +++ b/src/common/wpa_ctrl.h @@ -649,6 +649,7 @@ char * wpa_ctrl_get_remote_ifname(struct wpa_ctrl *ctrl); #endif /* CONFIG_CTRL_IFACE_UDP */ int wpa_ctrl_command(struct wpa_ctrl *ctrl, const char *cmd); +int wpa_ctrl_command_interactive(struct wpa_ctrl *ctrl, const char *cmd); int wpa_request(struct wpa_ctrl *ctrl, int argc, char *argv[]); #ifdef __cplusplus diff --git a/wpa_supplicant/wpa_cli_cmds.c b/wpa_supplicant/wpa_cli_cmds.c index df4947856..98559063f 100644 --- a/wpa_supplicant/wpa_cli_cmds.c +++ b/wpa_supplicant/wpa_cli_cmds.c @@ -41,6 +41,17 @@ static int wpa_cli_cmd(struct wpa_ctrl *ctrl, const char *cmd, int min_args, { char * buf = NULL; int ret = 0; + bool interactive = 0; + + for (int i = 0; i < argc; i++) { + if (strcmp(argv[i], "interactive") == 0) { + interactive = 1; + argv[i] = NULL; + argc--; + break; + } + } + if (argc < min_args) { wpa_printf(MSG_INFO, "Invalid %s command - at least %d argument%s " "required.\n", cmd, min_args, @@ -58,7 +69,11 @@ static int wpa_cli_cmd(struct wpa_ctrl *ctrl, const char *cmd, int min_args, ret = -1; goto out; } - ret = wpa_ctrl_command(ctrl, buf); + + if (interactive) + ret = wpa_ctrl_command_interactive(ctrl, buf); + else + ret = wpa_ctrl_command(ctrl, buf); out: if (buf) diff --git a/wpa_supplicant/wpa_cli_zephyr.c b/wpa_supplicant/wpa_cli_zephyr.c index 91d22178a..09b760b9c 100644 --- a/wpa_supplicant/wpa_cli_zephyr.c +++ b/wpa_supplicant/wpa_cli_zephyr.c @@ -325,6 +325,11 @@ char supp_make_argv(size_t *argc, const char **argv, char *cmd, } int wpa_ctrl_command(struct wpa_ctrl *ctrl, const char *cmd) +{ + return _wpa_ctrl_command(ctrl, cmd, 0, NULL); +} + +int wpa_ctrl_command_interactive(struct wpa_ctrl *ctrl, const char *cmd) { return _wpa_ctrl_command(ctrl, cmd, 1, NULL); }