]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix "code=995" bug with windows NDIS6 tap driver.
authorTDivine <tdivine@pcausa.com>
Wed, 22 Oct 2014 07:07:39 +0000 (10:07 +0300)
committerGert Doering <gert@greenie.muc.de>
Fri, 24 Oct 2014 18:34:25 +0000 (20:34 +0200)
Modification to address bug where OpenVPN enters state where it is
unresponsive and cannot be terminated. Log output is continuous spew
of "code=995" errors.

Revised fix for code=995 sped bug.

Adding new tap adapters while connected:
  https://community.openvpn.net/openvpn/ticket/430

Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1413961660-19251-2-git-send-email-samuli@openvpn.net>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9165
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1413961660-19251-3-git-send-email-samuli@openvpn.net>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9167
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/forward.c
src/openvpn/tun.h

index 39f66e3436a63ad7894b6d81ca6b2f66f27bfc7d..27b775fdf3790de4cc38a40f2a79b2b3fec3f9a5 100644 (file)
@@ -948,6 +948,15 @@ read_incoming_tun (struct context *c)
       return;            
     }
 
+  /* 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");
+     perf_pop();
+     return;
+  }
+
   /* Check the status return from read() */
   check_status (c->c2.buf.len, "read from TUN/TAP", NULL, c->c1.tuntap);
 
index 631b53c6812ad309226a49d5312f3e01f897d58a..79e2d188396a992a05db6866d33c1114227fb568 100644 (file)
@@ -391,6 +391,19 @@ tuntap_stop (int status)
   return false;
 }
 
+static inline bool
+tuntap_abort(int status)
+{
+  /*
+   * Typically generated when driver is halted.
+   */
+  if (status < 0)
+    {
+      return openvpn_errno() == ERROR_OPERATION_ABORTED;
+    }
+  return false;
+}
+
 static inline int
 tun_write_win32 (struct tuntap *tt, struct buffer *buf)
 {
@@ -432,6 +445,12 @@ tuntap_stop (int status)
   return false;
 }
 
+static inline bool
+tuntap_abort(int status)
+{
+  return false;
+}
+
 static inline void
 tun_standby_init (struct tuntap *tt)
 {