]> 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:36:32 +0000 (20:36 +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>
(cherry picked from commit 7aa178381241ae015273914065471e0d271ee1c3)

src/openvpn/forward.c
src/openvpn/tun.h

index 024cd58cfa9bcb0af44c4477f9c1d9eaabd38c76..7f0d083dbd817de75feda7854bc82658603cddec 100644 (file)
@@ -952,6 +952,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 085d6a3f0c7e31b6a569f77725ae051baccb41ea..1931c5207923a0d1f561dbe035179be5b0ce807b 100644 (file)
@@ -374,6 +374,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)
 {
@@ -415,6 +428,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)
 {