[PATCH 2/2] AP: Expire STA without entry in kernel
Masashi Honma
masashi.honma
Fri Jan 16 03:00:58 PST 2015
Signed-off-by: Masashi Honma <masashi.honma at gmail.com>
---
src/ap/sta_info.c | 7 +++++++
src/drivers/driver_nl80211.c | 2 ++
2 files changed, 9 insertions(+)
diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c
index b6a7e23..0ef3433 100644
--- a/src/ap/sta_info.c
+++ b/src/ap/sta_info.c
@@ -370,6 +370,13 @@ void ap_handle_timer(void *eloop_ctx, void *timeout_ctx)
* but do not disconnect the station now.
*/
next_time = hapd->conf->ap_max_inactivity + fuzz;
+ } else if (inactive_sec == -ENOENT) {
+ wpa_msg(hapd->msg_ctx, MSG_DEBUG,
+ "Station " MACSTR " leaved",
+ MAC2STR(sta->addr));
+
+ if (hapd->conf->skip_inactivity_poll)
+ sta->timeout_next = STA_DISASSOC;
} else if (inactive_sec < hapd->conf->ap_max_inactivity) {
/* station activity detected; reset timeout state */
wpa_msg(hapd->msg_ctx, MSG_DEBUG,
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 8b0ddde..dbf849a 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -5219,6 +5219,8 @@ static int i802_get_inact_sec(void *priv, const u8 *addr)
data.inactive_msec = (unsigned long) -1;
ret = i802_read_sta_data(priv, &data, addr);
+ if (ret == -ENOENT)
+ return -ENOENT;
if (ret || data.inactive_msec == (unsigned long) -1)
return -1;
return data.inactive_msec / 1000;
--
1.9.1
More information about the Hostap
mailing list