From 1eae55984d90e63269b5c3a9279e68f5211e26ab Mon Sep 17 00:00:00 2001 From: Stacey Marshall Date: Tue, 11 Apr 2023 18:49:25 +0100 Subject: [PATCH] unix,sunos: SO_REUSEPORT not valid on all sockets (#3949) Issue observed on Solaris with ISC BIND 9.18 which reported "unable to open route socket: unexpected error". illumos did not hit it because it does not have SO_REUSEPORT (open RFE https://www.illumos.org/issues/12455) --- src/unix/udp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/unix/udp.c b/src/unix/udp.c index 110467ae5..f556808fb 100644 --- a/src/unix/udp.c +++ b/src/unix/udp.c @@ -448,7 +448,8 @@ static int uv__set_reuse(int fd) { if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &yes, sizeof(yes))) return UV__ERR(errno); } -#elif defined(SO_REUSEPORT) && !defined(__linux__) && !defined(__GNU__) +#elif defined(SO_REUSEPORT) && !defined(__linux__) && !defined(__GNU__) && \ + !defined(__sun__) if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &yes, sizeof(yes))) return UV__ERR(errno); #else