commit 4f72ad9: [Fix] Fix multiple listen configuration

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Sep 16 14:35:07 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-09-16 15:33:26 +0100
URL: https://github.com/rspamd/rspamd/commit/4f72ad9744deb0141b3ad31722031a98aa5c4a58 (HEAD -> master)

[Fix] Fix multiple listen configuration

---
 src/libserver/worker_util.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c
index 89ebc10cb..2d40d057c 100644
--- a/src/libserver/worker_util.c
+++ b/src/libserver/worker_util.c
@@ -1056,7 +1056,7 @@ rspamd_handle_child_fork (struct rspamd_worker *wrk,
 		GList *elt = (GList *)v;
 		GList *our = cf->listen_socks;
 
-		if (our != elt) {
+		if (g_list_position (our, elt) == -1) {
 			GList *cur = elt;
 
 			while (cur) {
@@ -1064,7 +1064,10 @@ rspamd_handle_child_fork (struct rspamd_worker *wrk,
 						(struct rspamd_worker_listen_socket *)cur->data;
 
 				if (ls->fd != -1 && close (ls->fd) == -1) {
-					msg_err ("cannot close fd %d: %s", ls->fd, strerror (errno));
+					msg_err ("cannot close fd %d (addr = %s): %s",
+							ls->fd,
+							rspamd_inet_address_to_string_pretty (ls->addr),
+							strerror (errno));
 				}
 
 				cur = g_list_next (cur);


More information about the Commits mailing list