From 901ad59c83e7759faaa185c8d70662b2fe9ffb99 Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Thu, 13 Dec 2018 21:32:49 +0000 Subject: [PATCH] tcp sctp: Let the system pick the largest possible backlog value for `listen()` (#827) This commit applies the same changes made by b481169 (#693), to the TCP and SCTP server sockets. --- src/iperf_sctp.c | 3 ++- src/iperf_tcp.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/iperf_sctp.c b/src/iperf_sctp.c index 810cac4..c1cb134 100644 --- a/src/iperf_sctp.c +++ b/src/iperf_sctp.c @@ -37,6 +37,7 @@ #include #include #include +#include #ifdef HAVE_NETINET_SCTP_H #include @@ -234,7 +235,7 @@ iperf_sctp_listen(struct iperf_test *test) freeaddrinfo(res); - if (listen(s, 5) < 0) { + if (listen(s, INT_MAX) < 0) { i_errno = IESTREAMLISTEN; return -1; } diff --git a/src/iperf_tcp.c b/src/iperf_tcp.c index e16203a..f6ef78f 100644 --- a/src/iperf_tcp.c +++ b/src/iperf_tcp.c @@ -35,6 +35,7 @@ #include #include #include +#include #include "iperf.h" #include "iperf_api.h" @@ -301,7 +302,7 @@ iperf_tcp_listen(struct iperf_test *test) freeaddrinfo(res); - if (listen(s, 5) < 0) { + if (listen(s, INT_MAX) < 0) { i_errno = IESTREAMLISTEN; return -1; }