SO_REUSEPORT fix

This commit is contained in:
philippe44
2018-10-24 21:42:24 -07:00
parent af47f89d68
commit 3e57108f79
7 changed files with 2 additions and 1 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -127,11 +127,11 @@ static int create_recv_sock(uint32_t host) {
#if !defined(WIN32)
if (!getsockopt(sd, SOL_SOCKET, SO_REUSEPORT,(char*) &on, &addrlen)) {
on = 1;
if ((r = setsockopt(sd, SOL_SOCKET, SO_REUSEPORT,(char*) &on, sizeof(on))) < 0) {
log_message(LOG_ERR, "recv setsockopt(SO_REUSEPORT): %m", r);
}
}
on = 1;
#endif
/* bind to an address */
@@ -171,6 +171,7 @@ static int create_recv_sock(uint32_t host) {
#ifdef IP_PKTINFO
on = 1;
if ((r = setsockopt(sd, SOL_IP, IP_PKTINFO, (char *) &on, sizeof(on))) < 0) {
log_message(LOG_ERR, "recv setsockopt(IP_PKTINFO): %m");
return r;