]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Re-add TAP-Windows driver to installer, and update docs to reference its inclusion
authorDaniel Lenski <dlenski@gmail.com>
Fri, 12 Nov 2021 01:16:01 +0000 (17:16 -0800)
committerDaniel Lenski <dlenski@gmail.com>
Fri, 12 Nov 2021 01:25:02 +0000 (17:25 -0800)
This mostly reverts commit 8c1d2de09829d0930d1a7642b0729cd6cbf5ab67 ("Remove
TAP-Windows driver from installer, and update docs to reference Wintun's
default inclusion").

It appears that Wintun is not fully stable yet for OpenConnect VPN connections.
See #338 for two reports of instability (with #324 as a possible third), including
one where switching to TAP-Windows clearly resolved the issue.

Per https://gitlab.com/openconnect/openconnect/-/issues/338#note_731175712,
we should revert to installing and using TAP-Windows by default until we can figure out why.

OpenConnect will continue to use Wintun if TAP-Windows is unavailable, but will
issue a loud warning to the log.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
Makefile.am
openconnect.nsi.in
tun-win32.c
www/building.xml
www/changelog.xml

index 65d2e71e3efda1589b5a86dfab82708d339ef0dd..eea39a3ca1eb703f5256ea74de3e23d578036e06 100644 (file)
@@ -297,6 +297,20 @@ file-list.txt: Makefile.dlldeps openconnect$(EXEEXT) libopenconnect.la $(WINTUN_
 WINTUNDRIVER = wintun-0.13.zip
 WINTUNSHA256 = 34afe7d0de1fdb781af3defc0a75fd8c97daa756279b42dd6be6a1bd8ccdc7f0
 
+# OpenVPN TAP driver for Windows Vista/2003 and newer
+# (see https://community.openvpn.net/openvpn/wiki/GettingTapWindows)
+# XX: Newer releases exist, but are split between Win7+ and Win10+ versions.
+TAPDRIVER = tap-windows-9.21.2.exe
+TAPSHA256 = 645bee92ba4e9f32ddfdd9f8519dc1b9f9ff0b0a8e87e342f08d39da77e499a9
+
+$(TAPDRIVER):
+       curl https://build.openvpn.net/downloads/releases/tap-windows-9.21.2.exe -o $@
+
+# Validate file and also let make find it in VPATH
+file-list-$(TAPDRIVER).txt: $(TAPDRIVER)
+       echo $(TAPSHA256) $< | sha256sum -c
+       echo $< > $@
+
 $(WINTUNDRIVER):
        curl https://www.wintun.net/builds/$(WINTUNDRIVER) -o $@
 
@@ -318,10 +332,10 @@ file-list-%.txt: %
 # Rather than trying to get clever in NSIS and iterate over lists,
 # just emit raw snippets to be included separately in the install
 # and uninstall sections.
-instfiles.nsh: file-list.txt file-list-vpnc-script-win.js.txt
+instfiles.nsh: file-list.txt file-list-vpnc-script-win.js.txt file-list-$(TAPDRIVER).txt
        $(AM_V_GEN) cat $^ | while read FILE; do echo "File \"$${FILE}\"" ; done > $@
 
-uninstfiles.nsh: file-list.txt file-list-vpnc-script-win.js.txt
+uninstfiles.nsh: file-list.txt file-list-vpnc-script-win.js.txt file-list-$(TAPDRIVER).txt
        $(AM_V_GEN) cat $^ | while read FILE; do echo "Delete /rebootok \"\$$INSTDIR\\\\$${FILE##*/}\"" ; done > $@
 
 # Theoretically makensis can define symbols with the -D command line
index 1a0c47951b62624b5ed9fbca0f6d241244cab3f1..c6d89472af927df171dc1875613df4d700ce3957 100644 (file)
@@ -71,6 +71,21 @@ Section "Desktop Icons"
   CreateShortCut "$DESKTOP\openconnect.exe.lnk" "$INSTDIR\.\openconnect.exe" "" "$INSTDIR\.\openconnect.exe" 0
 SectionEnd
 
+Section "TAP-Windows driver"
+  MessageBox MB_OK \
+    "OpenConnect uses the TAP-Windows driver from OpenVPN to create virtual Ethernet adapters for \
+     VPN connections. If you haven't already installed this driver, you should now install v9.21.2, \
+     which works on Windows 2003, Windows Vista, or newer. \
+     More information on this driver, and available versions, can be found at \
+     https://community.openvpn.net/openvpn/wiki/GettingTapWindows"
+
+  MessageBox MB_YESNO "Install TAP-Windows driver v9.21.2?" /SD IDYES IDNO endTapWindows
+    DetailPrint "Running TAP-Windows driver setup..."
+    ExecWait "$INSTDIR\tap-windows-9.21.2.exe"
+    DetailPrint "Finished TAP-Windows driver setup"
+  endTapWindows:
+SectionEnd
+
 Section "Uninstall"
   Delete /rebootok "$DESKTOP\openconnect.exe.lnk"
   Delete /rebootok "$SMPROGRAMS\OpenConnect\openconnect.exe.lnk"
index 851b27354b309c9b6f8e3786a04bcc460126d63f..208c44a03bfaaab50e72014f51d552fe7679696c 100644 (file)
@@ -464,9 +464,15 @@ static intptr_t open_tun(struct openconnect_info *vpninfo, int adapter_type, cha
 
        get_adapter_index(vpninfo, guid);
 
-       vpn_progress(vpninfo, PRG_INFO, _("Using %s device '%s', index %d\n"),
+       vpn_progress(vpninfo, adapter_type ? PRG_ERR : PRG_INFO,
+                    _("Using %s device '%s', index %d\n"),
                     adapter_type ? "Wintun" : "TAP-Windows",
                     vpninfo->ifname, vpninfo->tun_idx);
+       if (adapter_type == ADAPTER_WINTUN)
+               vpn_progress(vpninfo, PRG_ERR,
+                            _("WARNING: Support for Wintun is experimental and may be unstable. If you\n"
+                              "  encounter problems, install the TAP-Windows driver instead. See\n"
+                              "  https://www.infradead.org/openconnect/building.html\n"));
 
        return ret;
 }
index eb3e84583498b1a546898d95a27c5668de718870..70b777d37f41ac7f187477e0c026c55e96a15abc 100644 (file)
@@ -111,6 +111,8 @@ it still doesn't build, please send the full output in a plain-text mail to the
 
 <h2>TUN/TAP driver</h2>
 
+<h3>Mac OS</h3>
+
 <p>Mac OS X users with OS X 10.6 or older, or using OpenConnect 6.00 or older,
 will also need to install the <a href="http://tuntaposx.sourceforge.net/">Mac OS X tun/tap driver</a>.
 Newer versions of OpenConnect will use the <tt>utun</tt> device on OS X which does not
@@ -118,11 +120,19 @@ require additional kernel modules to be installed.</p>
 <p>Solaris/OpenIndiana users will need the <a href="http://www.whiteboard.ne.jp/~admin2/tuntap/">Solaris TAP driver</a>.
 Note that for IPv6 support, the Solaris tun/tap driver from 16th Nov 2009 or newer is required.</p>
 
-<p>On Windows, OpenConnect can use either the
+<h3>Windows</h3>
+
+<p>On Windows, OpenConnect uses the
 <a href="https://community.openvpn.net/openvpn/wiki/GettingTapWindows">TAP-Windows driver from OpenVPN</a> (version 9.9 or
-later; requires Windows 2003 or newer) or the <a href="https://www.wintun.net">Wintun layer-3 driver from Wireguard</a>
-(requires Windows 7 or newer). The more modern Wintun driver is included in the OpenConnect installer, starting
-with OpenConnect v9.00.</p>
+later; requires Windows 2003 or newer). This driver is only available for the 32-bit and 64-bit x86
+architectures.</p>
+
+<p>OpenConnect v9.00 also contains <b><i>experimental</i></b> support for the
+<a href="https://www.wintun.net">Wintun layer-3 driver from Wireguard</a>
+(requires Windows 7 or newer). This is a more modern driver, and supports 32-bit and 64-bit ARM
+architectures as well, however it does not yet appear to be fully stable
+(see <a href="https://gitlab.com/openconnect/openconnect/-/issues/338">issue #338</a>).
+OpenConnect v9.00 will only attempt to use Wintun if TAP-Windows is unavailable.</p>
 
        <INCLUDE file="inc/footer.tmpl" />
 </PAGE>
index e0e7cb74450b4bd964de019d74a9d2801bcae700..3b4b40648a627dfd5369e47aecafc876411bb7a0 100644 (file)
@@ -38,7 +38,7 @@
        <li>Restore compatibility with newer Cisco servers, by no longer sending them the <tt>X-AnyConnect-Platform</tt> header (<a href="https://gitlab.com/openconnect/openconnect/-/issues/101">#101</a>, <a href="https://gitlab.com/openconnect/openconnect/-/merge_requests/175">!175</a>)</li>
        <li>Add support for PPP-based protocols, currently over TLS only (<a href="https://gitlab.com/openconnect/openconnect/-/merge_requests/165">!165</a>).</li>
        <li>Add support for two PPP-based protocols, F5 with <tt>--protocol=f5</tt> and Fortinet with <tt>--protocol=fortinet</tt> (<a href="https://gitlab.com/openconnect/openconnect/-/merge_requests/169">!169</a>).</li>
-       <li>Add support for <a href="https://www.wintun.net/">Wintun</a> Layer 3 TUN driver under Windows, and make it the default on Windows (<a href="https://gitlab.com/openconnect/openconnect/-/issues/231">#231</a>, <a href="https://gitlab.com/openconnect/openconnect/-/merge_requests/178">!178</a>).</li>
+       <li>Add experimental support for <a href="https://www.wintun.net/">Wintun</a> Layer 3 TUN driver under Windows (<a href="https://gitlab.com/openconnect/openconnect/-/issues/231">#231</a>, <a href="https://gitlab.com/openconnect/openconnect/-/merge_requests/178">!178</a>).</li>
        <li>Clean up and improve Windows routing/DNS configuration script (<a href="https://gitlab.com/openconnect/vpnc-scripts/-/merge_requests/26">vpnc-scripts!26</a>).</li>
        <li>On Windows, reclaim needed IP addresses from down network interfaces so that configuration script can succeed (<a href="https://gitlab.com/openconnect/openconnect/-/merge_requests/178">!178</a>).</li>
        <li>Fix output redirection under Windows (<a href="https://gitlab.com/openconnect/openconnect/-/issues/229">#229</a>)</li>