mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
Enable SO_LINGER to the so_reuseport_lb_test regression tests, preventing
many sockets in TIME_WAIT state at the end of the test. PR: 249885 Reviewed by: markj Approved by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D26549
This commit is contained in:
parent
8dc348a479
commit
0d46edd0bb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=366159
|
@ -54,6 +54,7 @@ lb_simple_accept_loop(int domain, const struct sockaddr *addr, int sds[],
|
||||||
size_t i;
|
size_t i;
|
||||||
int *acceptcnt;
|
int *acceptcnt;
|
||||||
int csd, error, excnt, sd;
|
int csd, error, excnt, sd;
|
||||||
|
const struct linger lopt = { 1, 0 };
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We expect each listening socket to accept roughly nconns/nsds
|
* We expect each listening socket to accept roughly nconns/nsds
|
||||||
|
@ -73,6 +74,10 @@ lb_simple_accept_loop(int domain, const struct sockaddr *addr, int sds[],
|
||||||
ATF_REQUIRE_MSG(error == 0, "connect() failed: %s",
|
ATF_REQUIRE_MSG(error == 0, "connect() failed: %s",
|
||||||
strerror(errno));
|
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.
|
* Poll the listening sockets.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue