OpenVPN / openvpn3

OpenVPN 3 is a C++ class library that implements the functionality of an OpenVPN client, and is protocol-compatible with the OpenVPN 2.x branch.
https://openvpn.net
Other
995 stars 397 forks source link

on Windows 10, cmake --build build --config Release --target ovpncli fails #156

Closed datajango closed 3 years ago

datajango commented 3 years ago

wintun and tap are missing.

G:\dv\openvpn\openvpn3\cmake..\openvpn/tun/win/client/tunsetup.hpp(149,7): error C2065: 'wintun': undeclared identifier [G:\dv\openvpn\build\test \ovpncli\ovpncli.vcxproj] G:\dv\openvpn\openvpn3\cmake..\openvpn/tun/win/client/tunsetup.hpp(149,17): error C2065: 'tap': undeclared identifier [G:\dv\openvpn\build\test\o vpncli\ovpncli.vcxproj] G:\dv\openvpn\openvpn3\cmake..\openvpn/tun/win/client/tunsetup.hpp(150,20): error C2065: 'tap': undeclared identifier [G:\dv\openvpn\build\test\o vpncli\ovpncli.vcxproj]

lstipakov commented 3 years ago

Indeed, thanks for spotting this. We've committed the fix to our internal SCM, will push to github soonish.

diff --git a/openvpn/tun/win/client/tunsetup.hpp b/openvpn/tun/win/client/tunsetup.hpp
index 6bb7d6f1..c091778a 100644
--- a/openvpn/tun/win/client/tunsetup.hpp
+++ b/openvpn/tun/win/client/tunsetup.hpp
@@ -146,8 +146,8 @@ namespace openvpn {
        if (ring_buffer)
          register_rings(th(), ring_buffer);

-       if (!wintun && tap.index_defined())
-         Util::flush_arp(tap.index, os);
+       if (tun_type_ == Type::TapWindows6 && tap_.index_defined())^M
+         Util::flush_arp(tap_.index, os);^M

        return th.release();
       }
dsommers commented 3 years ago

Commit 6da31163f69fc706fe0d should resolve this issue. Closing it now, please reopen if the issue is still present.