diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 5c3a73579..464a22682 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -1761,6 +1761,8 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s, if (os_strcmp(buf, "PING") == 0) { os_memcpy(reply, "PONG\n", 5); reply_len = 5; + } else if (os_strncmp(buf, "NOTE ", 5) == 0) { + wpa_printf(MSG_INFO, "NOTE: %s", buf + 5); } else if (os_strcmp(buf, "MIB") == 0) { reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size); if (reply_len >= 0) { diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c index 2d878c525..2a9261b09 100644 --- a/wpa_supplicant/wpa_cli.c +++ b/wpa_supplicant/wpa_cli.c @@ -371,6 +371,19 @@ static int wpa_cli_cmd_ping(struct wpa_ctrl *ctrl, int argc, char *argv[]) } +static int wpa_cli_cmd_note(struct wpa_ctrl *ctrl, int argc, char *argv[]) +{ + char cmd[256]; + int ret; + if (argc == 0) + return -1; + ret = os_snprintf(cmd, sizeof(cmd), "NOTE %s", argv[0]); + if (ret < 0 || (size_t) ret >= sizeof(cmd)) + return -1; + return wpa_ctrl_command(ctrl, cmd); +} + + static int wpa_cli_cmd_mib(struct wpa_ctrl *ctrl, int argc, char *argv[]) { return wpa_ctrl_command(ctrl, "MIB"); @@ -1578,6 +1591,9 @@ static struct wpa_cli_cmd wpa_cli_commands[] = { { "ping", wpa_cli_cmd_ping, cli_cmd_flag_none, "= pings wpa_supplicant" }, + { "note", wpa_cli_cmd_note, + cli_cmd_flag_none, + " = add a note to wpa_supplicant debug log" }, { "mib", wpa_cli_cmd_mib, cli_cmd_flag_none, "= get MIB variables (dot1x, dot11)" },