Fix #5&: failure to reset socket count on SIGHUP

As reported on GitHub. When logging to a remote host, after a few
SIGHUP's we get the following log message:

     Only 16 IP addresses per socket supported.

When closing all currently open sockets, the socket count must be reset
to allow for opening new ones, otherwise we'll run out of "counts".
Yes, this should be refactored to use the FreeBSD model implementation.

Problem introduced in v2.4.0, commit 075815e.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2022-07-26 07:47:09 +02:00
parent e41721216c
commit daba6cce09
2 changed files with 12 additions and 2 deletions

View File

@@ -2645,6 +2645,7 @@ static void init(void)
} else {
for (size_t i = 0; i < pe->pe_socknum; i++)
socket_close(pe->pe_sock[i]);
pe->pe_socknum = 0;
if (SecureMode < 2)
create_inet_socket(pe);