aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYogesh Ashok Powar <yogeshp@marvell.com>2011-12-25 18:57:01 (GMT)
committerJouni Malinen <j@w1.fi>2011-12-25 18:57:01 (GMT)
commitef01fa7bfa04093c7c98a8b82c0fc5d43d8a1b5d (patch)
tree773274a3fbed8cdab12b101b1b842f7a5ab81f1f /src
parentc3daee1df53f06a6b9dc36354e4bd0b85a222a36 (diff)
downloadhostap-ef01fa7bfa04093c7c98a8b82c0fc5d43d8a1b5d.zip
hostap-ef01fa7bfa04093c7c98a8b82c0fc5d43d8a1b5d.tar.gz
hostap-ef01fa7bfa04093c7c98a8b82c0fc5d43d8a1b5d.tar.bz2
hostapd: Make inactivity polling configurable
hostapd uses the poll method to check if the station is alive after the station has been inactive for ap_max_inactivity seconds. Make the poll mechanism configurable so that user can choose to disconnect idle clients. This can be especially useful when some devices/firmwares have restrictions on the number of clients that can connect to the AP and that limit is smaller than the total number of stations trying to use the AP. Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Diffstat (limited to 'src')
-rw-r--r--src/ap/ap_config.h1
-rw-r--r--src/ap/sta_info.c6
2 files changed, 6 insertions, 1 deletions
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index cc7122c..485092d 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -340,6 +340,7 @@ struct hostapd_bss_config {
int p2p;
int disassoc_low_ack;
+ int skip_inactivity_poll;
#define TDLS_PROHIBIT BIT(0)
#define TDLS_PROHIBIT_CHAN_SWITCH BIT(1)
diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c
index 27ab258..972a723 100644
--- a/src/ap/sta_info.c
+++ b/src/ap/sta_info.c
@@ -301,12 +301,16 @@ void ap_handle_timer(void *eloop_ctx, void *timeout_ctx)
"inactive too long: %d sec, max allowed: %d",
MAC2STR(sta->addr), inactive_sec,
hapd->conf->ap_max_inactivity);
+
+ if (hapd->conf->skip_inactivity_poll)
+ sta->timeout_next = STA_DISASSOC;
}
}
if ((sta->flags & WLAN_STA_ASSOC) &&
sta->timeout_next == STA_DISASSOC &&
- !(sta->flags & WLAN_STA_PENDING_POLL)) {
+ !(sta->flags & WLAN_STA_PENDING_POLL) &&
+ !hapd->conf->skip_inactivity_poll) {
wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR
" has ACKed data poll", MAC2STR(sta->addr));
/* data nullfunc frame poll did not produce TX errors; assume