Commit 839f33f5 authored by Francis Dupont's avatar Francis Dupont
Browse files

[master] Merged trac5243 (RedHat vs SO_REUSEPORT)

parents 6643aa9c 1d4a4d81
......@@ -80,8 +80,12 @@ PktFilterInet6::openSocket(const Iface& iface,
// in6addr_any (binding to port). Binding to port is required on some
// operating systems, e.g. NetBSD and OpenBSD so as the socket can
// join the socket to multicast group.
if (setsockopt(sock, SOL_SOCKET, SO_REUSEPORT,
(char *)&flag, sizeof(flag)) < 0) {
// RedHat 6.4 defines SO_REUSEPORT but the kernel does not support it
// and returns ENOPROTOOPT so ignore this error. Other versions may be
// affected, too.
if ((setsockopt(sock, SOL_SOCKET, SO_REUSEPORT,
(char *)&flag, sizeof(flag)) < 0) &&
(errno != ENOPROTOOPT)) {
isc_throw(SocketConfigError, "Can't set SO_REUSEPORT option on IPv6"
" socket.");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment