From: TDivine <tdiv...@pcausa.com>

Adding new tap adapters while connected:
 
https://community.openvpn.net/openvpn/ticket/430
---
 src/openvpn/tun.h | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/src/openvpn/tun.h b/src/openvpn/tun.h
index 631b53c..d84b777 100644
--- a/src/openvpn/tun.h
+++ b/src/openvpn/tun.h
@@ -380,15 +380,24 @@ int tun_finalize (HANDLE h, struct overlapped_io *io, 
struct buffer *buf);
 static inline bool
 tuntap_stop (int status)
 {
-  /*
-   * This corresponds to the STATUS_NO_SUCH_DEVICE
-   * error in tapdrvr.c.
-   */
-  if (status < 0)
-    {
-      return openvpn_errno () == ERROR_FILE_NOT_FOUND;
-    }
-  return false;
+   /*
+    * This corresponds to the STATUS_NO_SUCH_DEVICE
+    * error in tapdrvr.c.
+    */
+   if (status < 0)
+   {
+      status = openvpn_errno();
+      switch (status)
+      {
+      case ERROR_FILE_NOT_FOUND:
+      case ERROR_OPERATION_ABORTED:
+         return true;
+
+      default:
+         return false;
+      }
+   }
+   return false;
 }
 
 static inline int
-- 
1.9.1


Reply via email to