diff --git a/regress/netcat.c b/regress/netcat.c index 98a08b1ec..56bd09de5 100644 --- a/regress/netcat.c +++ b/regress/netcat.c @@ -738,7 +738,12 @@ local_listen(char *host, char *port, struct addrinfo hints) #ifdef SO_REUSEPORT ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x)); if (ret == -1) - err(1, "setsockopt"); + err(1, "setsockopt SO_REUSEPORT"); +#endif +#ifdef SO_REUSEADDR + ret = setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &x, sizeof(x)); + if (ret == -1) + err(1, "setsockopt SO_REUSEADDR"); #endif set_common_sockopts(s);