Open
Description
Describe the bug
My ISP is blocking openvpn, so I use openvpn via a socks5 proxy.
The initial connection from my client to the server always succeeds.
However, my OpenVPN server sometimes pushes the connection reset command to the client.
I found out that every connection immediately after connection reset would fail.
According to the log, when reconnecting after receiving the connection reset command, OpenVPN was not using the SOCKS proxy.
So I debugged this issue.
It seems that the following code is causing the bug.
// from socket.c:1697
static void
resolve_remote(struct link_socket *sock,
int phase,
const char **remote_dynamic,
struct signal_info *sig_info)
{
volatile int *signal_received = sig_info ? &sig_info->signal_received : NULL;
struct gc_arena gc = gc_new();
/* resolve remote address if undefined */
if (!sock->info.lsa->remote_list) // <<<<< remote_list is not null
{
....
}
if (link_socket_actual_defined(&sock->info.lsa->actual)) {....}
else
{
CLEAR(sock->info.lsa->actual);
if (sock->info.lsa->current_remote)
{
set_actual_address(&sock->info.lsa->actual,
sock->info.lsa->current_remote); // <<<<< runs up to here, the current_remote(openvpn server) instead of the proxy server is used
}
}
To Reproduce
- connect to server via a socks proxy
- server push reset command to client
Expected behavior
client connect to server via socks proxy
Version information (please complete the following information):
- OS: Windows 11 23H2
- OpenVPN version: 2.6.12
Additional context
Add any other context about the problem here.
Activity