From 2f72a17b8e835d7c13b35a9532fc958e3af18b2b Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Tue, 12 Nov 2019 13:25:21 +0100 Subject: [PATCH] syslogd: If system has SO_REUSEPORT, use it Signed-off-by: Joachim Nilsson --- src/socket.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/socket.c b/src/socket.c index 098da93..5e93997 100644 --- a/src/socket.c +++ b/src/socket.c @@ -128,6 +128,11 @@ skip: switch (family) { ERR("setsockopt(REUSEADDR), suspending inet"); return -1; } +#ifdef SO_REUSEPORT + if (setsockopt(sd, SOL_SOCKET, SO_REUSEPORT, &on, sizeof(on)) < 0) { + ERR("setsockopt(REUSEPORT), suspending inet"); + } +#endif break; }