diff options
author | tetsuya, kobayashi <tetsuya.x.kobayashi@sonymobile.com> | 2017-01-17 06:54:21 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-01-17 06:54:21 +0000 |
commit | ad8378003f950cdc3fe9fcde85ec9c31cff2e783 (patch) | |
tree | f26b2c734e7ed77415b2f94a41bb06639193a793 | |
parent | 9ee934853e5afc8936c36bcd5993a8cc2c44f42d (diff) | |
parent | 8677892d4e67a8ed53b49d0bb4ab0bafa6413b0d (diff) | |
download | ipsec-tools-ad8378003f950cdc3fe9fcde85ec9c31cff2e783.tar.gz |
Merge "VPN reconnection fails after manually disabling VPN" am: 34538ca099 am: db75984fe5 am: 7f8f84f958
am: 8677892d4e
Change-Id: Ia6eddb3739299cdf1794ea87273ee568e37d387c
-rw-r--r-- | main.c | 3 | ||||
-rw-r--r-- | setup.c | 9 |
2 files changed, 12 insertions, 0 deletions
@@ -124,6 +124,7 @@ const char *android_hook(char **envp) #endif extern void setup(int argc, char **argv); +extern void shutdown_session(); static int monitors; static void (*callbacks[10])(int fd); @@ -188,6 +189,8 @@ int main(int argc, char **argv) for (i = 0; i < monitors; ++i) { if (pollfds[i].revents & POLLHUP) { do_plog(LLV_INFO, "Connection is closed\n", pollfds[i].fd); + shutdown_session(); + /* Wait for few seconds to consume late messages. */ sleep(5); exit(1); @@ -53,6 +53,7 @@ #include "privsep.h" #include "throttle.h" #include "misc.h" +#include "handler.h" static struct localconf localconf; static struct sainfo sainfo; @@ -671,3 +672,11 @@ int throttle_host(struct sockaddr *addr, int fail) { return 0; } + +void shutdown_session() +{ + flushph2(); + flushph1(); + isakmp_close(); + pfkey_close(localconf.sock_pfkey); +} |