From b7231cf72503bd5132b32876af475496dd4299b2 Mon Sep 17 00:00:00 2001 From: Cy Schubert Date: Tue, 29 Sep 2020 17:05:35 +0000 Subject: [PATCH] Support SO_REUSEPORT_LB. This has been accepted by syslog-ng upstream and committed. It will be supported in the next release of syslog-ng. PR: syslog-ng329/Makefile Submitted by: Boris Korzun Reviewed by: Peter Czanik (syslog-ng upstream) --- sysutils/syslog-ng329/Makefile | 2 +- .../patch-modules_afsocket_socket-options.c | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 sysutils/syslog-ng329/files/patch-modules_afsocket_socket-options.c diff --git a/sysutils/syslog-ng329/Makefile b/sysutils/syslog-ng329/Makefile index 3bcf3a023688..b5eb1afaefb9 100644 --- a/sysutils/syslog-ng329/Makefile +++ b/sysutils/syslog-ng329/Makefile @@ -3,7 +3,7 @@ PORTNAME= syslog-ng DISTVERSION= 3.29.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils MASTER_SITES= https://github.com/balabit/syslog-ng/releases/download/syslog-ng-${DISTVERSION}/ .if !defined(MASTERDIR) diff --git a/sysutils/syslog-ng329/files/patch-modules_afsocket_socket-options.c b/sysutils/syslog-ng329/files/patch-modules_afsocket_socket-options.c new file mode 100644 index 000000000000..b92530e0fbda --- /dev/null +++ b/sysutils/syslog-ng329/files/patch-modules_afsocket_socket-options.c @@ -0,0 +1,20 @@ +--- modules/afsocket/socket-options.c.orig 2020-08-10 18:04:39 UTC ++++ modules/afsocket/socket-options.c +@@ -86,7 +86,16 @@ _setup_keepalive(gint fd) + static gboolean + _setup_reuseport(gint fd) + { +-#ifdef SO_REUSEPORT ++#if defined(SO_REUSEPORT_LB) ++ gint on = 1; ++ if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT_LB, &on, sizeof(on)) < 0) ++ { ++ msg_error("The kernel refused our SO_REUSEPORT_LB setting", ++ evt_tag_error("error")); ++ return FALSE; ++ } ++ return TRUE; ++#elif defined(SO_REUSEPORT) + gint on = 1; + if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &on, sizeof(on)) < 0) + {