aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasashi Honma <masashi.honma@gmail.com>2015-01-16 11:19:23 (GMT)
committerJouni Malinen <j@w1.fi>2015-01-19 00:35:43 (GMT)
commitb9749bac81cfd4132dfc87a5a94288005dfeec27 (patch)
tree6e5fe3263322106c229ce85979179e1cad252aaf
parenta114c7235a1fad4dbf7e0743e4aa33fb39aef142 (diff)
downloadhostap-b9749bac81cfd4132dfc87a5a94288005dfeec27.zip
hostap-b9749bac81cfd4132dfc87a5a94288005dfeec27.tar.gz
hostap-b9749bac81cfd4132dfc87a5a94288005dfeec27.tar.bz2
AP: Expire STA without entry in kernel
If the inactivity check returns that there is no entry remaining for the STA in the kernel, drop the STA in hostapd as well. Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
-rw-r--r--src/ap/sta_info.c7
-rw-r--r--src/drivers/driver_nl80211.c2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c
index 3eca82d..bb43218 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 " has lost its driver entry",
+ 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 c180f15..e278c87 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;