diff --git a/src/eapol.c b/src/eapol.c index 414d1c69..6732b370 100644 --- 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 index 1a1862bd..9462b56d 100644 --- 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 index 4ff5f010..1acee95e 100644 --- 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 index a66b2a17..517df83d 100644 --- 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);