Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Selva Nair <selva.nair <at> gmail.com>
Subject: [PATCH] Fix termination when windows suspends/sleeps
Newsgroups: gmane.network.openvpn.devel
Date: Wednesday 4th November 2015 18:59:38 UTC (over 2 years ago)
When TUN/TAP I/O operation is aborted, restart with a SIGHUP instead of
terminate. The abort error from TAP is often triggered by system suspend
which is fully recoverable on resume. Catastrophic events will get caught
later during the restart.  This solves the abnormal termination during
suspend/resume.

Signed-off-by: Selva Nair 
---
 src/openvpn/forward.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/openvpn/forward.c b/src/openvpn/forward.c
index 62eb6fc..cef063d 100644
--- a/src/openvpn/forward.c
+++ b/src/openvpn/forward.c
@@ -958,8 +958,9 @@ read_incoming_tun (struct context *c)
   /* Was TUN/TAP I/O operation aborted? */
   if (tuntap_abort(c->c2.buf.len))
   {
-     register_signal(c, SIGTERM, "tun-abort");
-     msg(M_FATAL, "TUN/TAP I/O operation aborted, exiting");
+     register_signal(c, SIGHUP, "tun-abort");
+     c->persist.restart_sleep_seconds = 10;
+     msg(M_INFO, "TUN/TAP I/O operation aborted, restarting");
      perf_pop();
      return;
   }
-- 
2.6.2


------------------------------------------------------------------------------
 
CD: 12ms