]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Lower RX_MGMT driver event debug level for Beacon frames
authorJouni Malinen <j@w1.fi>
Sun, 18 Dec 2011 19:48:25 +0000 (21:48 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 18 Dec 2011 19:48:25 +0000 (21:48 +0200)
This event can be very frequent in AP mode when Beacon frames from
neighboring BSSes are delivered to user space. Drop the debug
message priority from DEBUG to EXCESSIVE for Beacon frames.

Signed-hostap: Jouni Malinen <j@w1.fi>

src/ap/drv_callbacks.c
wpa_supplicant/events.c

index ba107de0d36ef17affa8e7ea9d2effdf1bafc3b4..b7febdc42d985714f89479c5b8e7a65e06349c2a 100644 (file)
@@ -469,9 +469,23 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
                          union wpa_event_data *data)
 {
        struct hostapd_data *hapd = ctx;
+#ifndef CONFIG_NO_STDOUT_DEBUG
+       int level = MSG_DEBUG;
 
-       wpa_dbg(hapd->msg_ctx, MSG_DEBUG, "Event %s (%d) received",
+       if (event == EVENT_RX_MGMT && data && data->rx_mgmt.frame &&
+           data->rx_mgmt.frame_len >= 24) {
+               const struct ieee80211_hdr *hdr;
+               u16 fc;
+               hdr = (const struct ieee80211_hdr *) data->rx_mgmt.frame;
+               fc = le_to_host16(hdr->frame_control);
+               if (WLAN_FC_GET_TYPE(fc) == WLAN_FC_TYPE_MGMT &&
+                   WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_BEACON)
+                       level = MSG_EXCESSIVE;
+       }
+
+       wpa_dbg(hapd->msg_ctx, level, "Event %s (%d) received",
                event_to_string(event), event);
+#endif /* CONFIG_NO_STDOUT_DEBUG */
 
        switch (event) {
        case EVENT_MICHAEL_MIC_FAILURE:
index 40b3026f5736b995fc62b8a01fa6b04c1d291629..ef9e1c3017c8ec38c0ffa492e9afd562f8a0292f 100644 (file)
@@ -1997,8 +1997,25 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
                return;
        }
 
-       wpa_dbg(wpa_s, MSG_DEBUG, "Event %s (%d) received",
+#ifndef CONFIG_NO_STDOUT_DEBUG
+{
+       int level = MSG_DEBUG;
+
+       if (event == EVENT_RX_MGMT && data && data->rx_mgmt.frame &&
+           data->rx_mgmt.frame_len >= 24) {
+               const struct ieee80211_hdr *hdr;
+               u16 fc;
+               hdr = (const struct ieee80211_hdr *) data->rx_mgmt.frame;
+               fc = le_to_host16(hdr->frame_control);
+               if (WLAN_FC_GET_TYPE(fc) == WLAN_FC_TYPE_MGMT &&
+                   WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_BEACON)
+                       level = MSG_EXCESSIVE;
+       }
+
+       wpa_dbg(wpa_s, level, "Event %s (%d) received",
                event_to_string(event), event);
+}
+#endif /* CONFIG_NO_STDOUT_DEBUG */
 
        switch (event) {
        case EVENT_AUTH: