summaryrefslogtreecommitdiff
path: root/src/starter/netkey.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/starter/netkey.c')
-rw-r--r--src/starter/netkey.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/starter/netkey.c b/src/starter/netkey.c
index 6646195cb..2b500bab4 100644
--- a/src/starter/netkey.c
+++ b/src/starter/netkey.c
@@ -16,17 +16,13 @@
#include <sys/stat.h>
#include <stdlib.h>
-#include <freeswan.h>
+#include <library.h>
#include <hydra.h>
-
-#include "../pluto/constants.h"
-#include "../pluto/defs.h"
-#include "../pluto/log.h"
+#include <utils/debug.h>
#include "files.h"
-bool
-starter_netkey_init(void)
+bool starter_netkey_init(void)
{
struct stat stb;
@@ -41,9 +37,7 @@ starter_netkey_init(void)
/* now test again */
if (stat(PROC_NETKEY, &stb) != 0)
{
- DBG(DBG_CONTROL,
- DBG_log("kernel appears to lack the native netkey IPsec stack")
- )
+ DBG2(DBG_APP, "kernel appears to lack the native netkey IPsec stack");
return FALSE;
}
}
@@ -58,15 +52,19 @@ starter_netkey_init(void)
ignore_result(system("modprobe -qv xfrm_user"));
}
- DBG(DBG_CONTROL,
- DBG_log("Found netkey IPsec stack")
- )
+ DBG2(DBG_APP, "found netkey IPsec stack");
return TRUE;
}
-void
-starter_netkey_cleanup(void)
+void starter_netkey_cleanup(void)
{
+ if (!lib->plugins->load(lib->plugins,
+ lib->settings->get_str(lib->settings, "starter.load", PLUGINS)))
+ {
+ DBG1(DBG_APP, "unable to load kernel plugins");
+ return;
+ }
hydra->kernel_interface->flush_sas(hydra->kernel_interface);
hydra->kernel_interface->flush_policies(hydra->kernel_interface);
+ lib->plugins->unload(lib->plugins);
}