mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-11-01 19:07:47 +00:00
69 lines
2.2 KiB
Diff
69 lines
2.2 KiB
Diff
From e15b04870a7d7517a9b129d8d5cbebe6b8a25cb8 Mon Sep 17 00:00:00 2001
|
|
From: John Crispin <john@phrozen.org>
|
|
Date: Wed, 29 Jul 2020 17:38:15 +0200
|
|
Subject: [PATCH 1/2] probe_request: ignore when rssi is too low
|
|
|
|
Signed-off-by: John Crispin <john@phrozen.org>
|
|
---
|
|
hostapd/config_file.c | 2 ++
|
|
src/ap/ap_config.c | 1 +
|
|
src/ap/ap_config.h | 1 +
|
|
src/ap/beacon.c | 4 ++++
|
|
4 files changed, 8 insertions(+)
|
|
|
|
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
|
|
index 13396aad2..e0b182c8e 100644
|
|
--- a/hostapd/config_file.c
|
|
+++ b/hostapd/config_file.c
|
|
@@ -4454,6 +4454,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) {
|
|
diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
|
|
index 56a4ac388..088bb831a 100644
|
|
--- a/src/ap/ap_config.c
|
|
+++ b/src/ap/ap_config.c
|
|
@@ -277,6 +277,7 @@ struct hostapd_config * hostapd_config_defaults(void)
|
|
|
|
conf->rssi_reject_assoc_rssi = 0;
|
|
conf->rssi_reject_assoc_timeout = 30;
|
|
+ conf->rssi_ignore_probe_request = 0;
|
|
|
|
#ifdef CONFIG_AIRTIME_POLICY
|
|
conf->airtime_update_interval = AIRTIME_DEFAULT_UPDATE_INTERVAL;
|
|
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
|
|
index 7fe418363..a69a8d324 100644
|
|
--- a/src/ap/ap_config.h
|
|
+++ b/src/ap/ap_config.h
|
|
@@ -1042,6 +1042,7 @@ struct hostapd_config {
|
|
|
|
int rssi_reject_assoc_rssi;
|
|
int rssi_reject_assoc_timeout;
|
|
+ int rssi_ignore_probe_request;
|
|
|
|
#ifdef CONFIG_AIRTIME_POLICY
|
|
enum {
|
|
diff --git a/src/ap/beacon.c b/src/ap/beacon.c
|
|
index ffb2e04d1..21fe04c2f 100644
|
|
--- a/src/ap/beacon.c
|
|
+++ b/src/ap/beacon.c
|
|
@@ -829,6 +829,10 @@ void handle_probe_req(struct hostapd_data *hapd,
|
|
struct radius_sta rad_info;
|
|
struct hostapd_data *resp_bss = hapd;
|
|
|
|
+ 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;
|
|
--
|
|
2.25.1
|
|
|