]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
WIN32: if IPv6 requested in TUN mode, and TUN/TAP driver version is older
authorGert Doering <gert@greenie.muc.de>
Sun, 7 Mar 2010 18:43:01 +0000 (19:43 +0100)
committerGert Doering <gert@greenie.muc.de>
Sun, 24 Apr 2011 15:22:42 +0000 (17:22 +0200)
       than 9.7, log warning and disable IPv6 (won't work anyway).

tun.c

diff --git a/tun.c b/tun.c
index ef49ae099e497f2ccbf2362ab9872a7aac988838..3c8fb22fb3661c29e624ceb5d5bec2cb15dbd6cf 100644 (file)
--- a/tun.c
+++ b/tun.c
@@ -4446,6 +4446,16 @@ open_tun (const char *dev, const char *dev_type, const char *dev_node, struct tu
       msg (M_FATAL, "ERROR:  This version of " PACKAGE_NAME " requires a TAP-Win32 driver that is at least version %d.%d -- If you recently upgraded your " PACKAGE_NAME " distribution, a reboot is probably required at this point to get Windows to see the new driver.",
           TAP_WIN32_MIN_MAJOR,
           TAP_WIN32_MIN_MINOR);
+
+    /* usage of numeric constants is ugly, but this is really tied to
+     * *this* version of the driver
+     */
+    if ( tt->ipv6 && tt->type == DEV_TYPE_TUN &&
+         info[0] == 9 && info[1] < 7)
+      {
+       msg( M_INFO, "WARNING:  Tap-Win32 driver version %d.%d does not support IPv6 in TUN mode.  IPv6 will be disabled.  Upgrade to Tap-Win32 9.7 or use TAP mode to get IPv6", (int) info[0], (int) info[1] );
+       tt->ipv6 = false;
+      }
   }
 
   /* get driver MTU */