[PATCH] AP: Do not reply to probe request with DS IE mismatch

Ilan Peer ilan.peer
Thu Feb 5 17:37:04 PST 2015


Do not reply to a probe request with a DS IE 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.

Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
 src/ap/beacon.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/ap/beacon.c b/src/ap/beacon.c
index b0a74e0..63c8d6d 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
@@ -579,6 +579,28 @@ void handle_probe_req(struct hostapd_data *hapd,
 		return;
 	}
 
+	/* No need to reply if the probe request was send on an adjacent
+	 * channel
+	 */
+	if (elems.ds_params && elems.ds_params_len == 1) {
+		u8 chan;
+
+		if (ieee80211_freq_to_chan(hapd->iface->freq,
+					   &chan) == NUM_HOSTAPD_MODES) {
+			wpa_printf(MSG_ERROR,
+				   "Failed to get interface channel for freq=%u",
+				   hapd->iface->freq);
+			return;
+		}
+
+		if (chan != elems.ds_params[0]) {
+			wpa_printf(MSG_DEBUG,
+				   "Ignore Probe Request due to DS mismatch. chan=%u != ds.chan=%u",
+				   chan, elems.ds_params[0]);
+			return;
+		}
+	}
+
 #ifdef CONFIG_P2P
 	if (hapd->p2p && elems.wps_ie) {
 		struct wpabuf *wps;
-- 
1.8.3.2




More information about the Hostap mailing list