3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 13:02:44 +01:00

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.
This commit is contained in:
James Prestwood 2019-10-11 12:29:24 -07:00 committed by Denis Kenzior
parent cb57d44cb4
commit 369c5fbd0b
4 changed files with 9 additions and 9 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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) {

View File

@ -4850,3 +4850,4 @@ void netdev_shutdown(void)
}
IWD_MODULE(netdev, netdev_init, netdev_exit);
IWD_MODULE_DEPENDS(netdev, eapol);