From patchwork Mon Aug 13 07:19:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Tobler X-Patchwork-Id: 956850 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cloudguard.ch Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="F30/Uu7j"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41pnFW3xt4z9s8T for ; Mon, 13 Aug 2018 17:20:47 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Date:Message-ID:Subject:From:To:Reply-To:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=Af4964DldH2DHBVChDEQ3Fys3ka6+cZyX0nWd3wzhZA=; b=F30/Uu7jUTbaJ5WNUBrqYev642 VvOUNDx87eDLcaHjugCWxOhqUnU+qTDH6wSKqaa1hNupkjAq3xrqKnMwOL9/MadXMFh0ndXx39ZgV XvKqFSoXhWR/Q9kvwTNy/lUyCIydf5IcSMNLKt/x1ANnlyaUh0Gc+ksK8Dp/0tYnQgCO/puAV+90W 6h0V9xScLLjEi3t3zXOYcgCXM/LW7/IzvUpW2E8VAgzbvAnAsqfpaJgQE1CP/l9RFtRBWaqhgCJbz mtKvOMRaGF5cfeKYr4pwKj64S5oENGwLc44InizB4wkG2yCci8SnZHjRu/78v8yiJuCZwrTmvak9o 7a8uo14g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fp79T-0006hL-7U; Mon, 13 Aug 2018 07:20:31 +0000 Received: from mx01.wlp.is ([185.12.129.23] helo=smtp.wlp.is) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fp796-0005pR-Nb for hostap@lists.infradead.org; Mon, 13 Aug 2018 07:20:15 +0000 Received: from bohrium.local (unknown [185.12.128.225]) (Authenticated sender: lnx-sys-mail) by smtp.wlp.is (Postfix) with ESMTPSA id 37FDB8005B for ; Mon, 13 Aug 2018 09:19:57 +0200 (CEST) To: hostap@lists.infradead.org From: Andreas Tobler Subject: [PATCH] hostapd: Send an event before throwing a station Message-ID: Date: Mon, 13 Aug 2018 09:19:56 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180813_002009_505185_7643862D X-CRM114-Status: GOOD ( 12.03 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Hi, We use the ctrl interface to record station connect/disconnect events. At the end of the day we often had more stations connected than the kernel reported. The result of the investigation of this issue is the attached patch. I hope the format is ok. Thanks, Andreas From 900e02ddd7872afa91f645b9af0f28c683ce3b7f Mon Sep 17 00:00:00 2001 From: Andreas Tobler Date: Mon, 13 Aug 2018 07:45:37 +0200 Subject: [PATCH] hostapd: Send an event before throwing a station If you modify the WLAN-STA-AUTHORIZED bit in sta->flags, you have to call the ap-sta-set-authorized() function to make sure the corresponding event is sent. Otherwise we leak entries in the event history. Signed-off-by: Andreas Tobler --- src/ap/ieee802_11.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index d7e7210f7..d8b34fa52 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -2014,6 +2014,7 @@ static void handle_auth(struct hostapd_data *hapd, * updated. To handle this, station's added_unassoc flag is * cleared once the station has completed association. */ + ap_sta_set_authorized(hapd, sta, 0); hostapd_drv_sta_remove(hapd, sta->addr); sta->flags &= ~(WLAN_STA_ASSOC | WLAN_STA_AUTH | WLAN_STA_AUTHORIZED);