mirror of
https://github.com/OpenVPN/openvpn3.git
synced 2024-09-20 04:02:15 +02:00
dcocli.cpp: add missing socket_protect call
As other transport clients, call socket_protect() before establishing connection. This gives ability to create bypass route. Signed-off-by: Lev Stipakov <lev@openvpn.net>
This commit is contained in:
parent
5bc16a71ef
commit
e419e07c7f
@ -790,6 +790,7 @@ namespace openvpn {
|
||||
transconf.frame = frame;
|
||||
transconf.stats = cli_stats;
|
||||
transconf.server_addr_float = server_addr_float;
|
||||
transconf.socket_protect = socket_protect;
|
||||
transport_factory = dco->new_transport_factory(transconf);
|
||||
}
|
||||
else if (alt_proxy)
|
||||
|
@ -335,6 +335,16 @@ namespace openvpn {
|
||||
transport_parent->transport_wait();
|
||||
udp().socket.open(udp().server_endpoint.protocol());
|
||||
|
||||
if (config->transport.socket_protect)
|
||||
{
|
||||
if (!config->transport.socket_protect->socket_protect(udp().socket.native_handle(), server_endpoint_addr()))
|
||||
{
|
||||
stop();
|
||||
transport_parent->transport_error(Error::UNDEF, "socket_protect error (UDP)");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
udp().socket.async_connect(udp().server_endpoint, [self=Ptr(this)](const openvpn_io::error_code& error)
|
||||
{
|
||||
self->start_impl_udp(error);
|
||||
|
@ -53,6 +53,7 @@ namespace openvpn {
|
||||
bool server_addr_float;
|
||||
Frame::Ptr frame;
|
||||
SessionStats::Ptr stats;
|
||||
SocketProtect* socket_protect = nullptr;
|
||||
};
|
||||
|
||||
struct TunConfig
|
||||
|
Loading…
Reference in New Issue
Block a user