2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

Add safeguard against the other usage of SO_REUSEPORT

This commit is contained in:
Ondřej Surý
2019-04-29 19:28:24 +02:00
parent e02228125e
commit 1c672367a0

View File

@@ -4475,12 +4475,14 @@ isc_socket_bind(isc_socket_t *sock0, const isc_sockaddr_t *sockaddr,
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d) failed", sock->fd);
}
#elif defined(__linux__) && defined(SO_REUSEPORT)
if (setsockopt(sock->fd, SOL_SOCKET, SO_REUSEPORT,
(void *)&on, sizeof(on)) < 0)
{
UNEXPECTED_ERROR(__FILE__, __LINE__,
"setsockopt(%d) failed", sock->fd);
}
#endif
/* Press on... */
}
#ifdef AF_UNIX