1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-22 17:39:53 +03:00

Save the correct server IP for route management

This commit is contained in:
Yihong Wu 2021-12-10 16:53:28 +08:00
parent 384ab07996
commit 02ee7b45d7

View File

@ -6403,7 +6403,7 @@ SOCK *ClientConnectGetSocket(CONNECTION *c, bool additional_connect)
if (additional_connect == false || IsZeroIP(&sock->RemoteIP)) if (additional_connect == false || IsZeroIP(&sock->RemoteIP))
{ {
if (((sock->IsRUDPSocket || sock->IPv6) && IsZeroIP(&sock->RemoteIP) == false && o->ProxyType == PROXY_DIRECT) || GetIP(&c->Session->ServerIP, hostname) == false) if (IsZeroIP(&sock->RemoteIP) == false || (sock->IPv6 && GetIP6(&c->Session->ServerIP, hostname) == false) || (sock->IPv6 == false && GetIP4(&c->Session->ServerIP, hostname) == false))
{ {
Copy(&c->Session->ServerIP, &sock->RemoteIP, sizeof(c->Session->ServerIP)); Copy(&c->Session->ServerIP, &sock->RemoteIP, sizeof(c->Session->ServerIP));
} }