AP: Do not reply to Probe Request frames with DS Params mismatch
authorIlan Peer <ilan.peer@intel.com>
Fri, 6 Feb 2015 01:37:04 +0000 (20:37 -0500)
committerJouni Malinen <j@w1.fi>
Sun, 8 Feb 2015 20:49:41 +0000 (22:49 +0200)
Do not reply to a Probe Request frame with a DSSS Parameter Set element
in which the channel is different than the operating channel of the AP,
as the sending station is not found on the AP's operating channel.

IEEE Std 802.11-2012 describes this as a requirement for an AP with
dot11RadioMeasurementActivated set to true, but strictly speaking does
not allow such ignoring of Probe Request frames if
dot11RadioMeasurementActivated is false. Anyway, this can help reduce
number of unnecessary Probe Response frames for cases where the STA is
less likely to see them (Probe Request frame sent on a neighboring, but
partially overlapping, channel).

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
src/ap/beacon.c

index b0a74e0..ffe7c92 100644 (file)
@@ -579,6 +579,27 @@ void handle_probe_req(struct hostapd_data *hapd,
                return;
        }
 
+       /*
+        * No need to reply if the Probe Request frame was sent on an adjacent
+        * channel. IEEE Std 802.11-2012 describes this as a requirement for an
+        * AP with dot11RadioMeasurementActivated set to true, but strictly
+        * speaking does not allow such ignoring of Probe Request frames if
+        * dot11RadioMeasurementActivated is false. Anyway, this can help reduce
+        * number of unnecessary Probe Response frames for cases where the STA
+        * is less likely to see them (Probe Request frame sent on a
+        * neighboring, but partially overlapping, channel).
+        */
+       if (elems.ds_params && elems.ds_params_len == 1 &&
+           hapd->iface->current_mode &&
+           (hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211G ||
+            hapd->iface->current_mode->mode == HOSTAPD_MODE_IEEE80211B) &&
+           hapd->iconf->channel != elems.ds_params[0]) {
+               wpa_printf(MSG_DEBUG,
+                          "Ignore Probe Request due to DS Params mismatch: chan=%u != ds.chan=%u",
+                          hapd->iconf->channel, elems.ds_params[0]);
+               return;
+       }
+
 #ifdef CONFIG_P2P
        if (hapd->p2p && elems.wps_ie) {
                struct wpabuf *wps;