From patchwork Sat Feb 23 14:47:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 222732 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 12A862C02A2 for ; Sun, 24 Feb 2013 01:47:44 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id A513B9D283; Sat, 23 Feb 2013 09:47:39 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fHd8xyyi3riA; Sat, 23 Feb 2013 09:47:39 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 2A1209D286; Sat, 23 Feb 2013 09:47:30 -0500 (EST) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 7261A9D2BC for ; Sat, 23 Feb 2013 09:47:29 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xSafw8YzOh87 for ; Sat, 23 Feb 2013 09:47:21 -0500 (EST) Received: from nbd.name (nbd.name [46.4.11.11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 889B89D283 for ; Sat, 23 Feb 2013 09:47:21 -0500 (EST) Received: by nf.lan (Postfix, from userid 501) id AE090280D895; Sat, 23 Feb 2013 15:47:17 +0100 (CET) From: Felix Fietkau To: hostap@lists.shmoo.com Subject: [PATCH 1/2] hostap: drop probe request if number of stations limit is reached Date: Sat, 23 Feb 2013 15:47:16 +0100 Message-Id: <1361630837-25472-1-git-send-email-nbd@openwrt.org> X-Mailer: git-send-email 1.8.0.2 Cc: j@w1.fi X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com 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 --- src/ap/beacon.c | 6 ++++++ 1 file changed, 6 insertions(+) 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;