diff mbox

[1/2] hostap: drop probe request if number of stations limit is reached

Message ID 1361630837-25472-1-git-send-email-nbd@openwrt.org
State Changes Requested
Headers show

Commit Message

Felix Fietkau Feb. 23, 2013, 2:47 p.m. UTC
If multiple APs serve the same SSID, and one of them is full, it should
not respond to probe requests anymore, as it won't allow clients to
connect anyway.

Signed-hostap: Felix Fietkau <nbd@openwrt.org>
---
 src/ap/beacon.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Jouni Malinen Feb. 28, 2013, 2:52 p.m. UTC | #1
On Sat, Feb 23, 2013 at 03:47:16PM +0100, Felix Fietkau wrote:
> If multiple APs serve the same SSID, and one of them is full, it should
> not respond to probe requests anymore, as it won't allow clients to
> connect anyway.

> diff --git a/src/ap/beacon.c b/src/ap/beacon.c
> @@ -455,6 +455,12 @@ void handle_probe_req(struct hostapd_data *hapd,
> +	if (!sta && hapd->num_sta >= hapd->conf->max_num_sta) {
> +		wpa_printf(MSG_MSGDUMP, "Probe Request from " MACSTR " ignored,"
> +			   " too many connected stations.", MAC2STR(mgmt->sa));
> +		return;
> +	}

This sounds reasonable for some use cases, but not necessarily all.
Probe Response frames may be used for other purposes than connecting to
the AP. For example, WPS PBC session overlap depends on scan results
included all APs that are in active PBC mode. Probe Response frames make
that more reliable. Similarly, Interworking may benefit from discovering
the AP and being able to fetch information from it even if another BSS
ends up getting used.

At minimum, this would need to be configurable behavior and it would
also be useful to allow the Probe Response frame go out in some cases
(e.g., that active WPS PBC case) regardless of configuration.
diff mbox

Patch

diff --git a/src/ap/beacon.c b/src/ap/beacon.c
index 4c47c75..3e0775e 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
@@ -455,6 +455,12 @@  void handle_probe_req(struct hostapd_data *hapd,
 		return;
 	}
 
+	if (!sta && hapd->num_sta >= hapd->conf->max_num_sta) {
+		wpa_printf(MSG_MSGDUMP, "Probe Request from " MACSTR " ignored,"
+			   " too many connected stations.", MAC2STR(mgmt->sa));
+		return;
+	}
+
 #ifdef CONFIG_INTERWORKING
 	if (elems.interworking && elems.interworking_len >= 1) {
 		u8 ant = elems.interworking[0] & 0x0f;