Skip to content

Commit

Permalink
sslh-fork: close all listening sockets in shoveler
Browse files Browse the repository at this point in the history
When we're watching multiple sockets, we don't want to just close
the active one we got a connection on before launching the shoveler.
If we want to restart the daemon, we run into problems because the
socket is still in use.  Instead, close all the sockets we were
listening on.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
  • Loading branch information
vapier committed Jan 9, 2014
1 parent 5998c9e commit 71ce828
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sslh-fork.c
Expand Up @@ -157,7 +157,8 @@ void main_loop(int listen_sockets[], int num_addr_listen)

if (!fork())
{
close(listen_sockets[i]);
for (i = 0; i < num_addr_listen; ++i)
close(listen_sockets[i]);
start_shoveler(in_socket);
exit(0);
}
Expand Down

0 comments on commit 71ce828

Please sign in to comment.