aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-02-28 01:54:06 (GMT)
committerJouni Malinen <j@w1.fi>2008-02-28 01:54:06 (GMT)
commitb0194fe07ed6afa84587f9c2dbaedfe4f8e0d45c (patch)
treeec916cb148ebdb6af98a7dcbb8438e770013354e /hostapd
parent4d6c3de3df71c4ac363a2f49cf730908f6b532f4 (diff)
downloadhostap-06-b0194fe07ed6afa84587f9c2dbaedfe4f8e0d45c.zip
hostap-06-b0194fe07ed6afa84587f9c2dbaedfe4f8e0d45c.tar.gz
hostap-06-b0194fe07ed6afa84587f9c2dbaedfe4f8e0d45c.tar.bz2
Added max_listen_interval configuration option
This allows associations to be denied if the STA tries to use too large listen interval. The default value is 65535 which matches with the field size limits.
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/config.c4
-rw-r--r--hostapd/config.h7
-rw-r--r--hostapd/hostapd.conf3
-rw-r--r--hostapd/ieee802_11.c9
4 files changed, 23 insertions, 0 deletions
diff --git a/hostapd/config.c b/hostapd/config.c
index 4280453..57fbb75 100644
--- a/hostapd/config.c
+++ b/hostapd/config.c
@@ -178,6 +178,8 @@ static void hostapd_config_defaults_bss(struct hostapd_bss_config *bss)
bss->radius_server_auth_port = 1812;
bss->ap_max_inactivity = AP_MAX_INACTIVITY;
bss->eapol_version = EAPOL_VERSION;
+
+ bss->max_listen_interval = 65535;
}
@@ -1927,6 +1929,8 @@ struct hostapd_config * hostapd_config_read(const char *fname)
} else if (os_strcmp(buf, "ieee80211w") == 0) {
bss->ieee80211w = atoi(pos);
#endif /* CONFIG_IEEE80211W */
+ } else if (os_strcmp(buf, "max_listen_interval") == 0) {
+ bss->max_listen_interval = atoi(pos);
} else {
printf("Line %d: unknown configuration item '%s'\n",
line, buf);
diff --git a/hostapd/config.h b/hostapd/config.h
index 8f7777e..4a7b24b 100644
--- a/hostapd/config.h
+++ b/hostapd/config.h
@@ -262,6 +262,13 @@ struct hostapd_bss_config {
struct hostapd_vlan *vlan, *vlan_tail;
macaddr bssid;
+
+ /*
+ * Maximum listen interval that STAs can use when associating with this
+ * BSS. If a STA tries to use larger value, the association will be
+ * denied with status code 51.
+ */
+ u16 max_listen_interval;
};
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index 539da45..3c9fc65 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -371,6 +371,9 @@ wme_ac_vo_acm=0
# default: do not control from hostapd (80211.o defaults to 1=enabled)
#bridge_packets=1
+# Maximum allowed Listen Interval (how many Beacon periods STAs are allowed to
+# remain asleep). Default: 65535 (no limit apart from field size)
+#max_listen_interval=100
##### IEEE 802.1X-2004 related configuration ##################################
diff --git a/hostapd/ieee802_11.c b/hostapd/ieee802_11.c
index e9a674f..388b19d 100644
--- a/hostapd/ieee802_11.c
+++ b/hostapd/ieee802_11.c
@@ -855,6 +855,15 @@ static void handle_assoc(struct hostapd_data *hapd,
goto fail;
}
+ if (listen_interval > hapd->conf->max_listen_interval) {
+ hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211,
+ HOSTAPD_LEVEL_DEBUG,
+ "Too large Listen Interval (%d)",
+ listen_interval);
+ resp = WLAN_STATUS_ASSOC_DENIED_LISTEN_INT_TOO_LARGE;
+ goto fail;
+ }
+
if (reassoc) {
os_memcpy(sta->previous_ap, mgmt->u.reassoc_req.current_ap,
ETH_ALEN);