summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libserver/worker_util.c5
-rw-r--r--src/rspamd.c6
2 files changed, 7 insertions, 4 deletions
diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c
index 2d40d057c..14394726d 100644
--- a/src/libserver/worker_util.c
+++ b/src/libserver/worker_util.c
@@ -985,6 +985,8 @@ rspamd_maybe_reuseport_socket (struct rspamd_worker_listen_socket *ls)
nfd = ls->fd;
#endif
+#if 0
+ /* This needed merely if we have reuseport for tcp, but for now it is disabled */
/* This means that we have an fd with no listening enabled */
if (nfd != -1) {
if (ls->type == RSPAMD_WORKER_SOCKET_TCP) {
@@ -993,6 +995,7 @@ rspamd_maybe_reuseport_socket (struct rspamd_worker_listen_socket *ls)
}
}
}
+#endif
return true;
}
@@ -1070,6 +1073,8 @@ rspamd_handle_child_fork (struct rspamd_worker *wrk,
strerror (errno));
}
+ ls->fd = -1;
+
cur = g_list_next (cur);
}
}
diff --git a/src/rspamd.c b/src/rspamd.c
index 6508b4e8c..5e87103eb 100644
--- a/src/rspamd.c
+++ b/src/rspamd.c
@@ -396,9 +396,7 @@ create_listen_socket (GPtrArray *addrs, guint cnt,
GList *result = NULL;
gint fd;
guint i;
- static const int listen_opts = RSPAMD_INET_ADDRESS_LISTEN_ASYNC|
- RSPAMD_INET_ADDRESS_LISTEN_REUSEPORT|
- RSPAMD_INET_ADDRESS_LISTEN_NOLISTEN;
+ static const int listen_opts = RSPAMD_INET_ADDRESS_LISTEN_ASYNC;
struct rspamd_worker_listen_socket *ls;
g_ptr_array_sort (addrs, rspamd_inet_address_compare_ptr);
@@ -422,7 +420,7 @@ create_listen_socket (GPtrArray *addrs, guint cnt,
if (listen_type & RSPAMD_WORKER_SOCKET_UDP) {
fd = rspamd_inet_address_listen (g_ptr_array_index (addrs, i),
SOCK_DGRAM,
- listen_opts, -1);
+ listen_opts | RSPAMD_INET_ADDRESS_LISTEN_REUSEPORT, -1);
if (fd != -1) {
ls = g_malloc0 (sizeof (*ls));
ls->addr = rspamd_inet_address_copy (g_ptr_array_index (addrs, i));