Commit 7a6c2e54 authored by Francis Dupont's avatar Francis Dupont
Browse files

[5243] Ignored ENOPROTOOPT on SO_REUSEPORT for RedHat

parent 0ce848c0
......@@ -80,8 +80,11 @@ 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 defines SO_REUSEPORT but the kernel does not support it
// and returns ENOPROTOOPT so ignore this error.
if ((setsockopt(sock, SOL_SOCKET, SO_REUSEPORT,
(char *)&flag, sizeof(flag)) < 0) &&
(errno != ENOPROTOOPT)) {
close(sock);
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