mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-30 05:47:45 +00:00
Ignore ENOPROTOOPT on SO_REUSEPORT for RedHat
This commit is contained in:
parent
3f2eb20663
commit
bf0b186371
@ -219,11 +219,14 @@ if_register_socket(struct interface_info *info, int family,
|
|||||||
* respective interfaces. This does not (and should not) affect
|
* respective interfaces. This does not (and should not) affect
|
||||||
* DHCPv4 sockets; we can't yet support BSD sockets well, much
|
* DHCPv4 sockets; we can't yet support BSD sockets well, much
|
||||||
* less multiple sockets. Make sense only with multicast.
|
* 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) && *do_multicast) {
|
if ((local_family == AF_INET6) && *do_multicast) {
|
||||||
flag = 1;
|
flag = 1;
|
||||||
if (setsockopt(sock, SOL_SOCKET, SO_REUSEPORT,
|
if ((setsockopt(sock, SOL_SOCKET, SO_REUSEPORT,
|
||||||
(char *)&flag, sizeof(flag)) < 0) {
|
(char *)&flag, sizeof(flag)) < 0) &&
|
||||||
|
(errno != ENOPROTOOPT)) {
|
||||||
log_fatal("Can't set SO_REUSEPORT option on dhcp "
|
log_fatal("Can't set SO_REUSEPORT option on dhcp "
|
||||||
"socket: %m");
|
"socket: %m");
|
||||||
}
|
}
|
||||||
|
@ -626,6 +626,16 @@ AC_CHECK_FUNCS(strlcat)
|
|||||||
# For HP/UX we need -lipv6 for if_nametoindex, perhaps others.
|
# For HP/UX we need -lipv6 for if_nametoindex, perhaps others.
|
||||||
AC_SEARCH_LIBS(if_nametoindex, [ipv6])
|
AC_SEARCH_LIBS(if_nametoindex, [ipv6])
|
||||||
|
|
||||||
|
# For some Solaris nanosleep is found by BIND in librt
|
||||||
|
have_nanosleep="no"
|
||||||
|
AC_CHECK_FUNC(nanosleep, have_nanosleep="yes")
|
||||||
|
if test "$have_nanosleep" = "no"; then
|
||||||
|
AC_CHECK_LIB(rt, nanosleep, have_nanosleep="rt")
|
||||||
|
fi
|
||||||
|
if test "$have_nanosleep" = "rt"; then
|
||||||
|
LIBS="-lrt $LIBS"
|
||||||
|
fi
|
||||||
|
|
||||||
# check for /dev/random (declares HAVE_DEV_RANDOM)
|
# check for /dev/random (declares HAVE_DEV_RANDOM)
|
||||||
AC_MSG_CHECKING(for random device)
|
AC_MSG_CHECKING(for random device)
|
||||||
AC_ARG_WITH(randomdev,
|
AC_ARG_WITH(randomdev,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user