aboutsummaryrefslogtreecommitdiff
path: root/socket.c
diff options
context:
space:
mode:
authorJames Yonan <james@openvpn.net>2010-03-30 04:20:55 +0000
committerJames Yonan <james@openvpn.net>2010-03-30 04:20:55 +0000
commit2b9b4c8a2d245a03098581de2d54b399e4bc4ad9 (patch)
treee03927668f30effd40bbd14d6662e3eb7c895b65 /socket.c
parentVersion 2.1.1c (diff)
downloadopenvpn-2b9b4c8a2d245a03098581de2d54b399e4bc4ad9.tar.xz
Set socket buffers (SO_SNDBUF and SO_RCVBUF) immediately after
socket is created rather than waiting until after connect/listen. Version 2.1.1d git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@5514 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to '')
-rw-r--r--socket.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/socket.c b/socket.c
index fecc398..65fbcd7 100644
--- a/socket.c
+++ b/socket.c
@@ -1291,6 +1291,10 @@ link_socket_init_phase1 (struct link_socket *sock,
else if (mode != LS_MODE_TCP_ACCEPT_FROM)
{
create_socket (sock);
+
+ /* set socket buffers based on --sndbuf and --rcvbuf options */
+ socket_set_buffers (sock->sd, &sock->socket_buffer_sizes);
+
resolve_bind_local (sock);
resolve_remote (sock, 1, NULL, NULL);
}
@@ -1493,9 +1497,6 @@ link_socket_init_phase2 (struct link_socket *sock,
}
}
- /* set socket buffers based on --sndbuf and --rcvbuf options */
- socket_set_buffers (sock->sd, &sock->socket_buffer_sizes);
-
/* set misc socket parameters */
socket_set_flags (sock->sd, sock->sockflags);