commit 369c5fbd0ba54e2db23ec9e3bfa3145dac770c8d
parent cb57d44cb48e02065ee3b4096b20a8f243dd9584
Author: James Prestwood <prestwoj@gmail.com>
Date: Fri, 11 Oct 2019 12:29:24 -0700
eapol: utilize IWD_MODULE
This converts eapol to using IWD modules. The init/exit APIs did need
to remain exposed for unit tests.
Netdev was updated to depend on eapol.
Diffstat:
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/eapol.c b/src/eapol.c
@@ -40,6 +40,7 @@
#include "src/handshake.h"
#include "src/watchlist.h"
#include "src/erp.h"
+#include "src/iwd.h"
static struct l_queue *state_machines;
static struct l_queue *preauths;
@@ -2705,16 +2706,16 @@ void __eapol_set_config(struct l_settings *config)
eapol_4way_handshake_time = 5;
}
-bool eapol_init()
+int eapol_init(void)
{
state_machines = l_queue_new();
preauths = l_queue_new();
watchlist_init(&frame_watches, &eapol_frame_watch_ops);
- return true;
+ return 0;
}
-bool eapol_exit()
+void eapol_exit(void)
{
if (!l_queue_isempty(state_machines))
l_warn("stale eapol state machines found");
@@ -2727,6 +2728,6 @@ bool eapol_exit()
l_queue_destroy(preauths, preauth_sm_destroy);
watchlist_destroy(&frame_watches);
-
- return true;
}
+
+IWD_MODULE(eapol, eapol_init, eapol_exit);
diff --git a/src/eapol.h b/src/eapol.h
@@ -128,5 +128,5 @@ struct preauth_sm *eapol_preauth_start(const uint8_t *aa,
eapol_preauth_destroy_func_t destroy);
void eapol_preauth_cancel(uint32_t ifindex);
-bool eapol_init();
-bool eapol_exit();
+int eapol_init(void);
+void eapol_exit(void);
diff --git a/src/main.c b/src/main.c
@@ -482,14 +482,12 @@ int main(int argc, char *argv[])
dbus_init(dbus);
eap_init(eap_mtu);
- eapol_init();
exit_status = l_main_run_with_signal(signal_handler, NULL);
plugin_exit();
iwd_modules_exit();
- eapol_exit();
eap_exit();
if (nl80211) {
diff --git a/src/netdev.c b/src/netdev.c
@@ -4850,3 +4850,4 @@ void netdev_shutdown(void)
}
IWD_MODULE(netdev, netdev_init, netdev_exit);
+IWD_MODULE_DEPENDS(netdev, eapol);