FS-5223 FS-6603 on platforms that have SO_REUSEPORT it also implies SO_REUSEADDR, On platforms that only have SO_REUSEADDR it seems to imply both in the absence of SO_REUSEPORT.

This commit is contained in:
Brian West 2014-06-17 21:15:02 -05:00
parent 5dbfc57308
commit 311889634b
2 changed files with 6 additions and 1 deletions

View File

@ -1 +1 @@
Mon Jun 9 14:22:59 EDT 2014
Tue Jun 17 21:14:36 CDT 2014

View File

@ -350,8 +350,13 @@ int su_getsocktype(su_socket_t s)
int su_setreuseaddr(su_socket_t s, int reuse)
{
#ifdef SO_REUSEPORT
return setsockopt(s, SOL_SOCKET, SO_REUSEPORT,
(void *)&reuse, (socklen_t)sizeof(reuse));
#else
return setsockopt(s, SOL_SOCKET, SO_REUSEADDR,
(void *)&reuse, (socklen_t)sizeof(reuse));
#endif
}