Set REUSE option on sockets to prevent failures associated with closing and immediately re-opening. Submitted by Gabriel Somlo.
This commit is contained in:
parent
f3ac6ef2b6
commit
26182f1f5d
5
crypto/dist/ipsec-tools/ChangeLog
vendored
5
crypto/dist/ipsec-tools/ChangeLog
vendored
@ -1,3 +1,8 @@
|
||||
2007-09-19 Matthew Grooms <mgrooms@shrew.net>
|
||||
From Gabriel Somlo <somlo@cmu.edu>
|
||||
* src/racoon/isakmp.c: Set REUSE option on sockets to prevent failures
|
||||
associated with closing and immediately re-opening.
|
||||
|
||||
2007-09-19 Matthew Grooms <mgrooms@shrew.net>
|
||||
From Gabriel Somlo <somlo@cmu.edu>
|
||||
* src/racoon/isakmp_unity.c: Prevent duplicate entries in splitnet list.
|
||||
|
16
crypto/dist/ipsec-tools/src/racoon/isakmp.c
vendored
16
crypto/dist/ipsec-tools/src/racoon/isakmp.c
vendored
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: isakmp.c,v 1.27 2007/07/18 12:07:51 vanhu Exp $ */
|
||||
/* $NetBSD: isakmp.c,v 1.28 2007/09/19 19:29:36 mgrooms Exp $ */
|
||||
|
||||
/* Id: isakmp.c,v 1.74 2006/05/07 21:32:59 manubsd Exp */
|
||||
|
||||
@ -1724,6 +1724,20 @@ isakmp_open()
|
||||
}
|
||||
#endif
|
||||
|
||||
if (setsockopt(p->sock, SOL_SOCKET,
|
||||
#ifdef __linux__
|
||||
SO_REUSEADDR,
|
||||
#else
|
||||
SO_REUSEPORT,
|
||||
#endif
|
||||
(void *)&yes, sizeof(yes)) < 0) {
|
||||
plog(LLV_ERROR, LOCATION, NULL,
|
||||
"failed to set REUSE flag on %s (%s).\n",
|
||||
saddr2str(p->addr), strerror(errno));
|
||||
close(p->sock);
|
||||
goto err_and_next;
|
||||
}
|
||||
|
||||
if (setsockopt_bypass(p->sock, p->addr->sa_family) < 0)
|
||||
goto err_and_next;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user