aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hostapd/main.c26
-rw-r--r--src/ap/hostapd.c5
-rw-r--r--src/ap/hostapd.h1
-rw-r--r--wpa_supplicant/ap.c7
-rw-r--r--wpa_supplicant/ap.h2
-rw-r--r--wpa_supplicant/wpa_supplicant.c6
6 files changed, 46 insertions, 1 deletions
diff --git a/hostapd/main.c b/hostapd/main.c
index 534f182..6c7406a 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -534,6 +534,28 @@ static int gen_uuid(const char *txt_addr)
#endif /* CONFIG_WPS */
+#ifndef HOSTAPD_CLEANUP_INTERVAL
+#define HOSTAPD_CLEANUP_INTERVAL 10
+#endif /* HOSTAPD_CLEANUP_INTERVAL */
+
+static int hostapd_periodic_call(struct hostapd_iface *iface, void *ctx)
+{
+ hostapd_periodic_iface(iface);
+ return 0;
+}
+
+
+/* Periodic cleanup tasks */
+static void hostapd_periodic(void *eloop_ctx, void *timeout_ctx)
+{
+ struct hapd_interfaces *interfaces = eloop_ctx;
+
+ eloop_register_timeout(HOSTAPD_CLEANUP_INTERVAL, 0,
+ hostapd_periodic, interfaces, NULL);
+ hostapd_for_each_interface(interfaces, hostapd_periodic_call, NULL);
+}
+
+
int main(int argc, char *argv[])
{
struct hapd_interfaces interfaces;
@@ -667,6 +689,9 @@ int main(int argc, char *argv[])
return -1;
}
+ eloop_register_timeout(HOSTAPD_CLEANUP_INTERVAL, 0,
+ hostapd_periodic, &interfaces, NULL);
+
if (fst_global_init()) {
wpa_printf(MSG_ERROR,
"Failed to initialize global FST context");
@@ -762,6 +787,7 @@ int main(int argc, char *argv[])
}
os_free(interfaces.iface);
+ eloop_cancel_timeout(hostapd_periodic, &interfaces, NULL);
hostapd_global_deinit(pid_file);
os_free(pid_file);
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index bcd6ce0..5135d3e 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -2922,3 +2922,8 @@ struct hostapd_data * hostapd_get_iface(struct hapd_interfaces *interfaces,
}
#endif /* NEED_AP_MLME */
+
+
+void hostapd_periodic_iface(struct hostapd_iface *iface)
+{
+}
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
index 38b35e5..d28a02a 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -445,6 +445,7 @@ void
hostapd_switch_channel_fallback(struct hostapd_iface *iface,
const struct hostapd_freq_params *freq_params);
void hostapd_cleanup_cs_params(struct hostapd_data *hapd);
+void hostapd_periodic_iface(struct hostapd_iface *iface);
/* utils.c */
int hostapd_register_probereq_cb(struct hostapd_data *hapd,
diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c
index aaea524..ce09c57 100644
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -1369,3 +1369,10 @@ void wpas_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s,
radar->chan_width, radar->cf1, radar->cf2);
}
#endif /* NEED_AP_MLME */
+
+
+void ap_periodic(struct wpa_supplicant *wpa_s)
+{
+ if (wpa_s->ap_iface)
+ hostapd_periodic_iface(wpa_s->ap_iface);
+}
diff --git a/wpa_supplicant/ap.h b/wpa_supplicant/ap.h
index 3f4151d..594168c 100644
--- a/wpa_supplicant/ap.h
+++ b/wpa_supplicant/ap.h
@@ -93,4 +93,6 @@ void wpas_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s,
void wpas_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s,
struct dfs_event *radar);
+void ap_periodic(struct wpa_supplicant *wpa_s);
+
#endif /* AP_H */
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index ac46ef7..3b107a1 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -4760,8 +4760,12 @@ static void wpas_periodic(void *eloop_ctx, void *timeout_ctx)
p2p_expire_peers(global->p2p);
#endif /* CONFIG_P2P */
- for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next)
+ for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) {
wpa_bss_flush_by_age(wpa_s, wpa_s->conf->bss_expiration_age);
+#ifdef CONFIG_AP
+ ap_periodic(wpa_s);
+#endif /* CONFIG_AP */
+ }
}