Mark ctrl_iface RX debug for PING commands excessive
authorJouni Malinen <jouni.malinen@atheros.com>
Fri, 24 Sep 2010 22:50:13 +0000 (15:50 -0700)
committerJouni Malinen <j@w1.fi>
Fri, 24 Sep 2010 22:50:13 +0000 (15:50 -0700)
This cleans up debug log from unnecessary entries when using
wpa_cli/hostapd_cli or other ctrl_iface monitors that PING
periodically to check connectivity.

hostapd/ctrl_iface.c
wpa_supplicant/ctrl_iface.c

index 1886b77..0407b6c 100644 (file)
@@ -710,6 +710,7 @@ static void hostapd_ctrl_iface_receive(int sock, void *eloop_ctx,
        char *reply;
        const int reply_size = 4096;
        int reply_len;
+       int level = MSG_DEBUG;
 
        res = recvfrom(sock, buf, sizeof(buf) - 1, 0,
                       (struct sockaddr *) &from, &fromlen);
@@ -718,7 +719,9 @@ static void hostapd_ctrl_iface_receive(int sock, void *eloop_ctx,
                return;
        }
        buf[res] = '\0';
-       wpa_hexdump_ascii(MSG_DEBUG, "RX ctrl_iface", (u8 *) buf, res);
+       if (os_strcmp(buf, "PING") == 0)
+               level = MSG_EXCESSIVE;
+       wpa_hexdump_ascii(level, "RX ctrl_iface", (u8 *) buf, res);
 
        reply = os_malloc(reply_size);
        if (reply == NULL) {
index ac5d067..3f288d0 100644 (file)
@@ -2676,7 +2676,10 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
                wpa_hexdump_ascii_key(MSG_DEBUG, "RX ctrl_iface",
                                      (const u8 *) buf, os_strlen(buf));
        } else {
-               wpa_hexdump_ascii(MSG_DEBUG, "RX ctrl_iface",
+               int level = MSG_DEBUG;
+               if (os_strcmp(buf, "PING") == 0)
+                       level = MSG_EXCESSIVE;
+               wpa_hexdump_ascii(level, "RX ctrl_iface",
                                  (const u8 *) buf, os_strlen(buf));
        }