From 9ced7621b5f25944dd756d45d5575fc87b27e507 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Mon, 1 Feb 2021 14:07:54 +0100 Subject: [PATCH] Fix a socket fd leak. Due to a logic error, whenever an interface went down and up, one or more socket fds could be leaked. A long running process on a roaming device or an unstable network could therefore run out of fds. --- src/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net.c b/src/net.c index 8bec6b67..ce999cba 100644 --- a/src/net.c +++ b/src/net.c @@ -700,7 +700,7 @@ void retry(meshlink_handle_t *mesh) { int sock = socket(sa.sa.sa_family, SOCK_STREAM, IPPROTO_TCP); - if(sock != -1) { + if(sock == -1) { continue; } -- 2.39.5