Index: tests/sys/netinet/so_reuseport_lb_test.c =================================================================== --- tests/sys/netinet/so_reuseport_lb_test.c +++ tests/sys/netinet/so_reuseport_lb_test.c @@ -54,6 +54,7 @@ size_t i; int *acceptcnt; int csd, error, excnt, sd; + const struct linger lopt = { 1, 0 }; /* * We expect each listening socket to accept roughly nconns/nsds @@ -73,6 +74,10 @@ ATF_REQUIRE_MSG(error == 0, "connect() failed: %s", strerror(errno)); + error = setsockopt(sd, SOL_SOCKET, SO_LINGER, &lopt, sizeof(lopt)); + ATF_REQUIRE_MSG(error == 0, "Setting linger failed: %s", + strerror(errno)); + /* * Poll the listening sockets. */