aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelva Nair2015-11-04 13:59:38 -0500
committerGert Doering2015-11-06 22:02:01 +0100
commit0d4ba251879c702b9474e26ff73a4f559d922d4f (patch)
treedf7cac8a9838a143a09c96ee9fe4e507d76b4a60
parentb155655a218686317c5d48ccbaaa6e8696820b88 (diff)
downloadopenvpn-0d4ba251879c702b9474e26ff73a4f559d922d4f.zip
openvpn-0d4ba251879c702b9474e26ff73a4f559d922d4f.tar.gz
Fix termination when windows suspends/sleeps
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> (cherry picked from commit ea66a2b5cdb21422139c421b4d3733e1c1c3937e)
-rw-r--r--src/openvpn/forward.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/openvpn/forward.c b/src/openvpn/forward.c
index 217fbb3..d55fa3b 100644
--- a/src/openvpn/forward.c
+++ b/src/openvpn/forward.c
@@ -956,8 +956,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;
}