diff options
author | Francis Dupont <fdupont@isc.org> | 2017-06-22 16:28:55 +0200 |
---|---|---|
committer | Francis Dupont <fdupont@isc.org> | 2017-06-22 16:28:55 +0200 |
commit | 3210343d1e7f626ab1368e2a37ccc3eb1846cc70 (patch) | |
tree | adad98d47dd0ade253a53879a06c80aabe8ddbc3 | |
parent | b16ddfe1960a09cbb01dce6410483042e3f5f086 (diff) | |
download | isc-dhcp-3210343d1e7f626ab1368e2a37ccc3eb1846cc70.tar.gz |
Ignore ENOPROTOOPT on SO_REUSEPORT for RedHat
-rw-r--r-- | common/socket.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/common/socket.c b/common/socket.c index c49317a0..0f5af494 100644 --- a/common/socket.c +++ b/common/socket.c @@ -213,11 +213,14 @@ if_register_socket(struct interface_info *info, int family, * respective interfaces. This does not (and should not) affect * DHCPv4 sockets; we can't yet support BSD sockets well, much * less multiple sockets. Make sense only with multicast. + * RedHat defines SO_REUSEPORT with a kernel which does not support + * it and returns ENOPROTOOPT so in this case ignore the error. */ if (local_family == AF_INET6) { flag = 1; - if (setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, - (char *)&flag, sizeof(flag)) < 0) { + if ((setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, + (char *)&flag, sizeof(flag)) < 0) && + (errno != ENOPROTOOPT)) { log_fatal("Can't set SO_REUSEPORT option on dhcp " "socket: %m"); } |