]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix termination when windows suspends/sleeps
authorSelva Nair <selva.nair@gmail.com>
Wed, 4 Nov 2015 18:59:38 +0000 (13:59 -0500)
committerGert Doering <gert@greenie.muc.de>
Fri, 6 Nov 2015 20:59:10 +0000 (21:59 +0100)
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 <selva.nair@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1446663578-14471-1-git-send-email-selva.nair@gmail.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/10438
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/forward.c

index 62eb6fc22eb3b7b46ac5d211eba9938798c6089d..cef063d9c300f2ce568d0cd8d12833853c402fee 100644 (file)
@@ -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;
   }