diff options
author | james <james@e7ae566f-a301-0410-adde-c780ea21d3b5> | 2006-11-01 21:21:01 +0000 |
---|---|---|
committer | james <james@e7ae566f-a301-0410-adde-c780ea21d3b5> | 2006-11-01 21:21:01 +0000 |
commit | 7d770f1e8d2e21fbd7886ee1744007b86c5a3ece (patch) | |
tree | aa90ef60d12a972a49c6d5ffb5cd4a3200c4c7ce | |
parent | Prevent SIGUSR1 or SIGHUP from causing program (diff) | |
download | openvpn-7d770f1e8d2e21fbd7886ee1744007b86c5a3ece.tar.xz |
SO_REUSEADDR should not be set on Windows TCP sockets because
it will cause bind to succeed on port conflicts.
git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@1428 e7ae566f-a301-0410-adde-c780ea21d3b5
-rw-r--r-- | socket.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -482,6 +482,7 @@ create_socket_tcp (void) if ((sd = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) msg (M_SOCKERR, "Cannot create TCP socket"); +#ifndef WIN32 /* using SO_REUSEADDR on Windows will cause bind to succeed on port conflicts! */ /* set SO_REUSEADDR on socket */ { int on = 1; @@ -489,6 +490,7 @@ create_socket_tcp (void) (void *) &on, sizeof (on)) < 0) msg (M_SOCKERR, "TCP: Cannot setsockopt SO_REUSEADDR on TCP socket"); } +#endif #if 0 /* set socket linger options */ |