@@ -10685,7 +10685,7 @@ fail:
#endif /* CONFIG_FILS */
-static int wpas_ctrl_cmd_debug_level(const char *cmd)
+int wpas_ctrl_cmd_debug_level(const char *cmd)
{
if (os_strcmp(cmd, "PING") == 0 ||
os_strncmp(cmd, "BSS ", 4) == 0 ||
@@ -122,6 +122,8 @@ void wpa_supplicant_global_ctrl_iface_deinit(
void wpas_ctrl_radio_work_flush(struct wpa_supplicant *wpa_s);
+int wpas_ctrl_cmd_debug_level(const char *cmd);
+
#else /* CONFIG_CTRL_IFACE */
static inline struct ctrl_iface_priv *
@@ -162,6 +164,10 @@ static inline void wpas_ctrl_radio_work_flush(struct wpa_supplicant *wpa_s)
{
}
+static inline int wpas_ctrl_cmd_debug_level(const char *cmd)
+{
+}
+
#endif /* CONFIG_CTRL_IFACE */
#endif /* CTRL_IFACE_H */
@@ -337,6 +337,8 @@ static void wpa_supplicant_ctrl_iface_receive(int sock, void *eloop_ctx,
else
reply_len = 2;
} else {
+ int level = wpas_ctrl_cmd_debug_level(buf);
+ sockaddr_print(level, "Control interface recv command from:", &from, fromlen);
reply = wpa_supplicant_ctrl_iface_process(wpa_s, pos,
&reply_len);
}
@@ -178,6 +178,8 @@ static void wpa_supplicant_ctrl_iface_receive(int sock, void *eloop_ctx,
else
reply_len = 2;
} else {
+ int level = wpas_ctrl_cmd_debug_level(buf);
+ sockaddr_print(level, "Control interface recv command from:", &from, fromlen);
reply_buf = wpa_supplicant_ctrl_iface_process(wpa_s, buf,
&reply_len);
reply = reply_buf;
sometimes there is a program error to send a large number of commands to the WPA, and the source address can help quickly find the program that sends commands. Signed-off-by: xinpeng wang <wangxinpeng@uniontech.com> --- wpa_supplicant/ctrl_iface.c | 2 +- wpa_supplicant/ctrl_iface.h | 6 ++++++ wpa_supplicant/ctrl_iface_udp.c | 2 ++ wpa_supplicant/ctrl_iface_unix.c | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-)