commit 5dac1cf: [Minor] REUSEPORT is broken everywhere but Linux

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Jun 10 10:56:07 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-06-10 11:53:23 +0100
URL: https://github.com/rspamd/rspamd/commit/5dac1cff96ff04cc43d690d3cbaf7ba23b8abaa7 (HEAD -> master)

[Minor] REUSEPORT is broken everywhere but Linux

---
 src/libserver/worker_util.c | 2 +-
 src/libutil/addr.c          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c
index df3cb7fdf..1c7069521 100644
--- a/src/libserver/worker_util.c
+++ b/src/libserver/worker_util.c
@@ -953,7 +953,7 @@ rspamd_maybe_reuseport_socket (struct rspamd_worker_listen_socket *ls)
 		return true;
 	}
 
-#if defined(SO_REUSEPORT) && defined(SO_REUSEADDR)
+#if defined(SO_REUSEPORT) && defined(SO_REUSEADDR) && defined(LINUX)
 
 	nfd = rspamd_inet_address_listen (ls->addr,
 			(ls->type == RSPAMD_WORKER_SOCKET_UDP ? SOCK_DGRAM : SOCK_STREAM),
diff --git a/src/libutil/addr.c b/src/libutil/addr.c
index bb98dbee2..782b05254 100644
--- a/src/libutil/addr.c
+++ b/src/libutil/addr.c
@@ -1079,7 +1079,7 @@ rspamd_inet_address_listen (const rspamd_inet_addr_t *addr, gint type,
 	}
 #endif
 
-#if defined(SO_REUSEPORT)
+#if defined(SO_REUSEPORT) && defined(LINUX)
 	if (opts & RSPAMD_INET_ADDRESS_LISTEN_REUSEPORT) {
 		on = 1;
 


More information about the Commits mailing list