mirror of
https://github.com/anope/anope.git
synced 2026-07-02 06:46:38 +02:00
BUILD : 1.7.21 (1417) BUGS : NOTES : Set SO_REUSEADDR on sock to prevent potential issues with bind() failing after a restart
git-svn-id: svn://svn.anope.org/anope/trunk@1417 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1132 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
parent
1f637024fc
commit
0030f51a2d
@@ -48,6 +48,7 @@ Anope Version S V N
|
||||
08/15 F CS OP now correctly works if there is only 1 user in the channel. [#922]
|
||||
08/17 F Various InspIRCd issues. [#832]
|
||||
08/18 F CS GETKEY response. [#880]
|
||||
08/21 F Potential issues caused by not setting SO_REUSEADDR on socket. [ #00]
|
||||
|
||||
Provided by Robin Burchell <w00t@inspircd.org> - 2008
|
||||
08/08 F Strict warnings in send.c from comparing address of non-ptr [ #00]
|
||||
|
||||
@@ -559,6 +559,7 @@ int conn(const char *host, int port, const char *lhost, int lport)
|
||||
#endif
|
||||
struct sockaddr_in sa, lsa;
|
||||
ano_socket_t sock;
|
||||
int sockopt = 1;
|
||||
|
||||
memset(&lsa, 0, sizeof(lsa));
|
||||
if (lhost) {
|
||||
@@ -598,6 +599,11 @@ int conn(const char *host, int port, const char *lhost, int lport)
|
||||
if ((sock = socket(sa.sin_family, SOCK_STREAM, 0)) < 0)
|
||||
return -1;
|
||||
|
||||
if (setsockopt
|
||||
(sock, SOL_SOCKET, SO_REUSEADDR, (char *) &sockopt,
|
||||
sizeof(int)) < 0)
|
||||
alog("debug: couldn't set SO_REUSEADDR on socket");
|
||||
|
||||
if ((lhost || lport)
|
||||
&& bind(sock, (struct sockaddr *) &lsa, sizeof(lsa)) < 0) {
|
||||
int errno_save = ano_sockgeterr();
|
||||
|
||||
+5
-1
@@ -9,10 +9,14 @@ VERSION_MAJOR="1"
|
||||
VERSION_MINOR="7"
|
||||
VERSION_PATCH="21"
|
||||
VERSION_EXTRA="-svn"
|
||||
VERSION_BUILD="1416"
|
||||
VERSION_BUILD="1417"
|
||||
|
||||
# $Log$
|
||||
#
|
||||
# BUILD : 1.7.21 (1417)
|
||||
# BUGS :
|
||||
# NOTES : Set SO_REUSEADDR on sock to prevent potential issues with bind() failing after a restart
|
||||
#
|
||||
# BUILD : 1.7.21 (1416)
|
||||
# BUGS : 880
|
||||
# NOTES : Changed CS GETKEY response to what the help for GS GETKEY says it should be
|
||||
|
||||
Reference in New Issue
Block a user