From 47864388853c1e26d9375902ae43d5b5faaf8a3e Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sat, 25 Sep 2021 18:30:57 -0400 Subject: Set SO_REUSEADDR in quick --- bin/quick.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/quick.c b/bin/quick.c index d6361aad..edf35a3b 100644 --- a/bin/quick.c +++ b/bin/quick.c @@ -122,6 +122,9 @@ int main(int argc, char *argv[]) { if (server < 0) err(EX_OSERR, "socket"); fcntl(server, F_SETFD, FD_CLOEXEC); + int on = 1; + setsockopt(server, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); + struct sockaddr_in addr = { .sin_family = AF_INET, .sin_port = htons(port), -- cgit 1.4.1