aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2015-07-20 10:39:22 (GMT)
committerJouni Malinen <j@w1.fi>2015-07-20 10:39:22 (GMT)
commit22fd2822f9020f66be230aa32c0169d8cef82ad7 (patch)
tree235f027a090260928105b9637d4527db83bbcbd9
parent3188aabaf1b04ac40c5baa8270cee72862568205 (diff)
downloadhostap-22fd2822f9020f66be230aa32c0169d8cef82ad7.zip
hostap-22fd2822f9020f66be230aa32c0169d8cef82ad7.tar.gz
hostap-22fd2822f9020f66be230aa32c0169d8cef82ad7.tar.bz2
Move hostapd_acl_expire() to use common AP periodic cleanup mechanism
This reduces number of periodic eloop timeouts when AP mode operations are in progress. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
-rw-r--r--src/ap/hostapd.c12
-rw-r--r--src/ap/ieee802_11_auth.c12
-rw-r--r--src/ap/ieee802_11_auth.h1
3 files changed, 15 insertions, 10 deletions
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 5135d3e..0ae8f4a 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -2926,4 +2926,16 @@ struct hostapd_data * hostapd_get_iface(struct hapd_interfaces *interfaces,
void hostapd_periodic_iface(struct hostapd_iface *iface)
{
+ size_t i;
+
+ for (i = 0; i < iface->num_bss; i++) {
+ struct hostapd_data *hapd = iface->bss[i];
+
+ if (!hapd->started)
+ continue;
+
+#ifndef CONFIG_NO_RADIUS
+ hostapd_acl_expire(hapd);
+#endif /* CONFIG_NO_RADIUS */
+ }
}
diff --git a/src/ap/ieee802_11_auth.c b/src/ap/ieee802_11_auth.c
index 0238257..531a67d 100644
--- a/src/ap/ieee802_11_auth.c
+++ b/src/ap/ieee802_11_auth.c
@@ -399,19 +399,15 @@ static void hostapd_acl_expire_queries(struct hostapd_data *hapd,
/**
* hostapd_acl_expire - ACL cache expiration callback
- * @eloop_ctx: struct hostapd_data *
- * @timeout_ctx: Not used
+ * @hapd: struct hostapd_data *
*/
-static void hostapd_acl_expire(void *eloop_ctx, void *timeout_ctx)
+void hostapd_acl_expire(struct hostapd_data *hapd)
{
- struct hostapd_data *hapd = eloop_ctx;
struct os_reltime now;
os_get_reltime(&now);
hostapd_acl_expire_cache(hapd, &now);
hostapd_acl_expire_queries(hapd, &now);
-
- eloop_register_timeout(10, 0, hostapd_acl_expire, hapd, NULL);
}
@@ -615,8 +611,6 @@ int hostapd_acl_init(struct hostapd_data *hapd)
if (radius_client_register(hapd->radius, RADIUS_AUTH,
hostapd_acl_recv_radius, hapd))
return -1;
-
- eloop_register_timeout(10, 0, hostapd_acl_expire, hapd, NULL);
#endif /* CONFIG_NO_RADIUS */
return 0;
@@ -632,8 +626,6 @@ void hostapd_acl_deinit(struct hostapd_data *hapd)
struct hostapd_acl_query_data *query, *prev;
#ifndef CONFIG_NO_RADIUS
- eloop_cancel_timeout(hostapd_acl_expire, hapd, NULL);
-
hostapd_acl_cache_free(hapd->acl_cache);
#endif /* CONFIG_NO_RADIUS */
diff --git a/src/ap/ieee802_11_auth.h b/src/ap/ieee802_11_auth.h
index 2bc1065..b66f244 100644
--- a/src/ap/ieee802_11_auth.h
+++ b/src/ap/ieee802_11_auth.h
@@ -24,5 +24,6 @@ int hostapd_allowed_address(struct hostapd_data *hapd, const u8 *addr,
int hostapd_acl_init(struct hostapd_data *hapd);
void hostapd_acl_deinit(struct hostapd_data *hapd);
void hostapd_free_psk_list(struct hostapd_sta_wpa_psk_short *psk);
+void hostapd_acl_expire(struct hostapd_data *hapd);
#endif /* IEEE802_11_AUTH_H */