aboutsummaryrefslogtreecommitdiffstats
path: root/src/radius
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-12-14 11:31:12 (GMT)
committerJouni Malinen <j@w1.fi>2014-12-14 13:47:04 (GMT)
commit2c6411edd052117b221c36775b53088f7d5d707a (patch)
tree405336b9cff3dd7d3847966cd036bfc3f08b87d7 /src/radius
parent777bbe7a3c7f9f93e03b8302c2169b5041013ad5 (diff)
downloadhostap-2c6411edd052117b221c36775b53088f7d5d707a.zip
hostap-2c6411edd052117b221c36775b53088f7d5d707a.tar.gz
hostap-2c6411edd052117b221c36775b53088f7d5d707a.tar.bz2
ERP: Add ERP_FLUSH for hostapd
This can be used to drop any pending ERP key from both the internal AP authentication server and RADIUS server use of hostapd. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/radius')
-rw-r--r--src/radius/radius_server.c26
-rw-r--r--src/radius/radius_server.h1
2 files changed, 20 insertions, 7 deletions
diff --git a/src/radius/radius_server.c b/src/radius/radius_server.c
index b315277..85a485e 100644
--- a/src/radius/radius_server.c
+++ b/src/radius/radius_server.c
@@ -1820,15 +1820,31 @@ radius_server_init(struct radius_server_conf *conf)
/**
- * radius_server_deinit - Deinitialize RADIUS server
+ * radius_server_erp_flush - Flush all ERP keys
* @data: RADIUS server context from radius_server_init()
*/
-void radius_server_deinit(struct radius_server_data *data)
+void radius_server_erp_flush(struct radius_server_data *data)
{
struct eap_server_erp_key *erp;
if (data == NULL)
return;
+ while ((erp = dl_list_first(&data->erp_keys, struct eap_server_erp_key,
+ list)) != NULL) {
+ dl_list_del(&erp->list);
+ bin_clear_free(erp, sizeof(*erp));
+ }
+}
+
+
+/**
+ * radius_server_deinit - Deinitialize RADIUS server
+ * @data: RADIUS server context from radius_server_init()
+ */
+void radius_server_deinit(struct radius_server_data *data)
+{
+ if (data == NULL)
+ return;
if (data->auth_sock >= 0) {
eloop_unregister_read_sock(data->auth_sock);
@@ -1856,11 +1872,7 @@ void radius_server_deinit(struct radius_server_data *data)
sqlite3_close(data->db);
#endif /* CONFIG_SQLITE */
- while ((erp = dl_list_first(&data->erp_keys, struct eap_server_erp_key,
- list)) != NULL) {
- dl_list_del(&erp->list);
- bin_clear_free(erp, sizeof(*erp));
- }
+ radius_server_erp_flush(data);
os_free(data);
}
diff --git a/src/radius/radius_server.h b/src/radius/radius_server.h
index 1b8967c..ca4e38c 100644
--- a/src/radius/radius_server.h
+++ b/src/radius/radius_server.h
@@ -235,6 +235,7 @@ struct radius_server_conf {
struct radius_server_data *
radius_server_init(struct radius_server_conf *conf);
+void radius_server_erp_flush(struct radius_server_data *data);
void radius_server_deinit(struct radius_server_data *data);
int radius_server_get_mib(struct radius_server_data *data, char *buf,