]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add option to ignore Probe Request frames when RSSI is too low
authorJohn Crispin <john@phrozen.org>
Wed, 12 Aug 2020 16:55:31 +0000 (18:55 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 2 Dec 2020 15:14:39 +0000 (17:14 +0200)
Add a new hostapd configuration parameters rssi_ignore_probe_request to
ignore Probe Request frames received with too low RSSI.

Signed-off-by: John Crispin <john@phrozen.org>
hostapd/config_file.c
hostapd/hostapd.conf
src/ap/ap_config.h
src/ap/beacon.c

index af2445563ae5a67bdcd856a37a6eed2ef5bdbb73..b3dc8f81a99984b8e7e4a3327c8ae2694e105877 100644 (file)
@@ -4450,6 +4450,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                conf->rssi_reject_assoc_rssi = atoi(pos);
        } else if (os_strcmp(buf, "rssi_reject_assoc_timeout") == 0) {
                conf->rssi_reject_assoc_timeout = atoi(pos);
+       } else if (os_strcmp(buf, "rssi_ignore_probe_request") == 0) {
+               conf->rssi_ignore_probe_request = atoi(pos);
        } else if (os_strcmp(buf, "pbss") == 0) {
                bss->pbss = atoi(pos);
        } else if (os_strcmp(buf, "transition_disable") == 0) {
index 21f7b1e1316bc2755227b6eaa1355bced04243ca..3ac64a75e96333e166ecde5066a9cfafce846fda 100644 (file)
@@ -2735,6 +2735,10 @@ own_ip_addr=127.0.0.1
 # threshold (range: 0..255, default=30).
 #rssi_reject_assoc_timeout=30
 
+# Ignore Probe Request frames if RSSI is below given threshold (in dBm)
+# Allowed range: -60 to -90 dBm; default = 0 (rejection disabled)
+#rssi_ignore_probe_request=-75
+
 ##### Fast Session Transfer (FST) support #####################################
 #
 # The options in this section are only available when the build configuration
index b6937cbc07ba0698ab2780fbb5c35d6c303a0425..f7a344e0ea4daa082870c5d4cdd7ccf0d959bde5 100644 (file)
@@ -1039,6 +1039,7 @@ struct hostapd_config {
 
        int rssi_reject_assoc_rssi;
        int rssi_reject_assoc_timeout;
+       int rssi_ignore_probe_request;
 
 #ifdef CONFIG_AIRTIME_POLICY
        enum {
index 807fe0ff956e0845abef82ab304fba16f6f4826f..47b260e810e8e1e78a3f1f3c2b36978fd6193f3a 100644 (file)
@@ -818,6 +818,10 @@ void handle_probe_req(struct hostapd_data *hapd,
        size_t csa_offs_len;
        struct radius_sta rad_info;
 
+       if (hapd->iconf->rssi_ignore_probe_request && ssi_signal &&
+           ssi_signal < hapd->iconf->rssi_ignore_probe_request)
+               return;
+
        if (len < IEEE80211_HDRLEN)
                return;
        ie = ((const u8 *) mgmt) + IEEE80211_HDRLEN;