[PATCH] hostapd: Send an event before throwing a station

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <andreas.tobler@xxxxxxxxxxxxx>
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 <andreas.tobler@xxxxxxxxxxxxx>
---
 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);
-- 
2.17.1

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap

[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux