summaryrefslogtreecommitdiff
path: root/src/starter/netkey.c
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2013-01-02 14:18:20 +0100
committerYves-Alexis Perez <corsac@debian.org>2013-01-02 14:18:20 +0100
commitc1343b3278cdf99533b7902744d15969f9d6fdc1 (patch)
treed5ed3dc5677a59260ec41cd39bb284d3e94c91b3 /src/starter/netkey.c
parentb34738ed08c2227300d554b139e2495ca5da97d6 (diff)
downloadvyos-strongswan-c1343b3278cdf99533b7902744d15969f9d6fdc1.tar.gz
vyos-strongswan-c1343b3278cdf99533b7902744d15969f9d6fdc1.zip
Imported Upstream version 5.0.1
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..25f68e505 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 <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, NULL,
+ 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);
}