summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2018-02-08 12:36:22 +1100
committerDarren Tucker <dtucker@dtucker.net>2018-02-08 12:42:12 +1100
commitaee49b2a89b6b323c80dd3b431bd486e51f94c8c (patch)
tree81001bcb8fff6c8a41479c1c2d31bed79f932600 /regress
parent1749991c55bab716877b7c687cbfbf19189ac6f1 (diff)
Set SO_REUSEADDR in regression test netcat.
Sometimes multiplex tests fail on Solaris with "netcat: local_listen: Address already in use" which is likely due to previous invocations leaving the port in TIME_WAIT. Set SO_REUSEADDR (in addition to SO_REUSEPORT which is alread set on platforms that support it). ok djm@
Diffstat (limited to 'regress')
-rw-r--r--regress/netcat.c7
1 files changed, 6 insertions, 1 deletions
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)
738#ifdef SO_REUSEPORT 738#ifdef SO_REUSEPORT
739 ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x)); 739 ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x));
740 if (ret == -1) 740 if (ret == -1)
741 err(1, "setsockopt"); 741 err(1, "setsockopt SO_REUSEPORT");
742#endif
743#ifdef SO_REUSEADDR
744 ret = setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &x, sizeof(x));
745 if (ret == -1)
746 err(1, "setsockopt SO_REUSEADDR");
742#endif 747#endif
743 set_common_sockopts(s); 748 set_common_sockopts(s);
744 749