From bd5aaaac7f48e6788999d3c291f566933dc9daa6 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Fri, 21 May 2021 11:14:50 +0200 Subject: tcp: Actually enforce MAX_CONNS limit and, given that the connection table is indexed by socket number, we also need to increase MAX_CONNS now as the ICMP implementation needs 2^17 sockets, that will be opened before TCP connections are accepted. This needs to be changed later: the connection table should be indexed by a translated number -- we're wasting 2^17 table entries otherwise. Move initialisation of TCP listening sockets as last per-protocol initialisation, this will make it easier. Signed-off-by: Stefano Brivio --- passt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'passt.c') diff --git a/passt.c b/passt.c index 12b10dc..466cae8 100644 --- a/passt.c +++ b/passt.c @@ -787,7 +787,7 @@ int main(int argc, char **argv) fd_unix = sock_unix(); - if (icmp_sock_init(&c) || tcp_sock_init(&c) || udp_sock_init(&c)) + if (icmp_sock_init(&c) || udp_sock_init(&c) || tcp_sock_init(&c)) exit(EXIT_FAILURE); if (c.v6) -- cgit v1.2.3