Merge commit '688ce110819545502762729feaa505b67e2fe58e' into feature/update-dependencies

This commit is contained in:
Sergey Abramchuk
2019-10-25 20:14:12 +03:00
12 changed files with 90 additions and 34 deletions
@@ -262,7 +262,13 @@ namespace openvpn {
bool socket_protect(int socket, IP::Addr endpoint) override
{
if (parent)
return parent->socket_protect(socket, endpoint.to_string(), endpoint.is_ipv6());
{
#if defined(OPENVPN_COMMAND_AGENT) && defined(OPENVPN_PLATFORM_WIN)
return WinCommandAgent::add_bypass_route(endpoint);
#else
return parent->socket_protect(socket, endpoint.to_string(), endpoint.is_ipv6());
#endif
}
else
return true;
}
@@ -659,7 +665,7 @@ namespace openvpn {
catch (const std::exception& e)
{
eval.error = true;
eval.message = Unicode::utf8_printable<std::string>(e.what(), 256);
eval.message = Unicode::utf8_printable<std::string>(std::string("ERR_PROFILE_GENERIC: ") + e.what(), 256);
}
}
@@ -807,6 +813,11 @@ namespace openvpn {
return ret;
}
OPENVPN_CLIENT_EXPORT bool OpenVPNClient::socket_protect(int socket, std::string remote, bool ipv6)
{
return true;
}
OPENVPN_CLIENT_EXPORT bool OpenVPNClient::parse_dynamic_challenge(const std::string& cookie, DynamicChallenge& dc)
{
try {
@@ -977,8 +988,8 @@ namespace openvpn {
#ifdef OPENVPN_GREMLIN
cc.gremlin_config = state->gremlin_config;
#endif
#if defined(USE_TUN_BUILDER)
cc.socket_protect = &state->socket_protect;
#if defined(USE_TUN_BUILDER)
cc.builder = this;
#endif
#if defined(OPENVPN_EXTERNAL_TUN_FACTORY)
@@ -495,7 +495,7 @@ namespace openvpn {
// Callback to "protect" a socket from being routed through the tunnel.
// Will be called from the thread executing connect().
// The remote and ipv6 are the remote host this socket will connect to
virtual bool socket_protect(int socket, std::string remote, bool ipv6) = 0;
virtual bool socket_protect(int socket, std::string remote, bool ipv6);
// Primary VPN client connect method, doesn't return until disconnect.
// Should be called by a worker thread. This method will make callbacks