From cef27b8576a7967f87f58b091e8b622b4b134b1b Mon Sep 17 00:00:00 2001 From: Sven Geuer <68420948@users.noreply.github.com> Date: Sun, 21 Jan 2024 23:04:33 +0100 Subject: [PATCH] As worker, close the unneeded listening socket. --- proxytunnel.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/proxytunnel.c b/proxytunnel.c index 210948b..e489a5a 100644 --- a/proxytunnel.c +++ b/proxytunnel.c @@ -343,6 +343,9 @@ void do_daemon() if ( ( pid = fork() ) < 0 ) { my_perror( "Cannot fork worker" ); } else if ( pid == 0 ) { + /* As worker, we do not need to listen for new connections */ + close(listen_sd); + read_fd = write_fd = sd_client; /* Create a stdin/out stream */