ctrl: Print the source address of the received commands
Sometimes there is a program error to send a large number of commands to wpa_supplicant, and the source address can help quickly find the program that sends commands. Signed-off-by: xinpeng wang <wangxinpeng@uniontech.com>
This commit is contained in:
parent
f942149684
commit
0aae045af0
4 changed files with 9 additions and 1 deletions
|
@ -10697,7 +10697,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 *
|
||||
|
|
|
@ -337,6 +337,9 @@ static void wpa_supplicant_ctrl_iface_receive(int sock, void *eloop_ctx,
|
|||
else
|
||||
reply_len = 2;
|
||||
} else {
|
||||
sockaddr_print(wpas_ctrl_cmd_debug_level(buf),
|
||||
"Control interface recv command from:",
|
||||
&from, fromlen);
|
||||
reply = wpa_supplicant_ctrl_iface_process(wpa_s, pos,
|
||||
&reply_len);
|
||||
}
|
||||
|
|
|
@ -178,6 +178,9 @@ static void wpa_supplicant_ctrl_iface_receive(int sock, void *eloop_ctx,
|
|||
else
|
||||
reply_len = 2;
|
||||
} else {
|
||||
sockaddr_print(wpas_ctrl_cmd_debug_level(buf),
|
||||
"Control interface recv command from:",
|
||||
&from, fromlen);
|
||||
reply_buf = wpa_supplicant_ctrl_iface_process(wpa_s, buf,
|
||||
&reply_len);
|
||||
reply = reply_buf;
|
||||
|
|
Loading…
Reference in a new issue