summaryrefslogtreecommitdiff
path: root/net-firewall/nftlb/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-05-14 11:09:11 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-05-14 11:09:11 +0100
commitdeba8115d2c2af26df42966b91ef04ff4dd79cde (patch)
tree9a48f42594e1a9e6b2020d5535a784314434d7a7 /net-firewall/nftlb/files
parent38423c67c8a23f6a1bc42038193182e2da3116eb (diff)
gentoo resync : 14.05.2020
Diffstat (limited to 'net-firewall/nftlb/files')
-rw-r--r--net-firewall/nftlb/files/nftlb-0.6-musl.patch72
-rw-r--r--net-firewall/nftlb/files/nftlb-0.6-tests.patch47
2 files changed, 119 insertions, 0 deletions
diff --git a/net-firewall/nftlb/files/nftlb-0.6-musl.patch b/net-firewall/nftlb/files/nftlb-0.6-musl.patch
new file mode 100644
index 000000000000..99990726f05e
--- /dev/null
+++ b/net-firewall/nftlb/files/nftlb-0.6-musl.patch
@@ -0,0 +1,72 @@
+diff --git a/configure.ac b/configure.ac
+index 4e7b0a9..2396857 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2,6 +2,7 @@ AC_INIT([nftlb], [0.6], [netfilter-devel@vger.kernel.org])
+
+ AC_CONFIG_AUX_DIR([build-aux])
+ AC_CONFIG_MACRO_DIR([m4])
++AC_CONFIG_HEADERS([config.h])
+ AM_INIT_AUTOMAKE([-Wall foreign subdir-objects
+ tar-pax no-dist-gzip dist-bzip2 1.6])
+
+@@ -25,5 +26,7 @@ AC_CHECK_HEADER([ev.h], [EVENTINC="-include ev.h"],
+ [EVENTINC="-include libev/ev.h"],
+ [AC_MSG_ERROR([ev.h not found])])])
+
++AC_CHECK_HEADERS([execinfo.h])
++
+ AC_CONFIG_FILES([Makefile src/Makefile])
+ AC_OUTPUT
+diff --git a/src/main.c b/src/main.c
+index b6b5ec4..b2a080f 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -18,6 +18,7 @@
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
++#include "config.h"
+
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -26,7 +27,10 @@
+ #include <syslog.h>
+ #include <errno.h>
+ #include <unistd.h>
++
++#ifdef HAVE_EXECINFO_H
+ #include <execinfo.h>
++#endif /* HAVE_EXECINFO_H */
+
+ #include "config.h"
+ #include "objects.h"
+@@ -85,6 +89,7 @@ static void nftlb_sighandler(int signo)
+ exit(EXIT_SUCCESS);
+ }
+
++#ifdef HAVE_EXECINFO_H
+ static void nftlb_trace() {
+ void *buffer[255];
+ char **str;
+@@ -106,6 +111,7 @@ static void nftlb_trace() {
+
+ exit(EXIT_FAILURE);
+ }
++#endif /* HAVE_EXECINFO_H */
+
+ int main(int argc, char *argv[])
+ {
+@@ -157,8 +163,12 @@ int main(int argc, char *argv[])
+
+ if (signal(SIGINT, nftlb_sighandler) == SIG_ERR ||
+ signal(SIGTERM, nftlb_sighandler) == SIG_ERR ||
++#ifdef HAVE_EXECINFO_H
+ signal(SIGPIPE, SIG_IGN) == SIG_ERR ||
+ signal(SIGSEGV, nftlb_trace) == SIG_ERR) {
++#else
++ signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
++#endif /* HAVE_EXECINFO_H */
+ fprintf(stderr, "Error assigning signals\n");
+ syslog(LOG_ERR, "Error assigning signals");
+ return EXIT_FAILURE;
diff --git a/net-firewall/nftlb/files/nftlb-0.6-tests.patch b/net-firewall/nftlb/files/nftlb-0.6-tests.patch
new file mode 100644
index 000000000000..05baa7ee03a3
--- /dev/null
+++ b/net-firewall/nftlb/files/nftlb-0.6-tests.patch
@@ -0,0 +1,47 @@
+diff --git a/tests/exec_tests.sh b/tests/exec_tests.sh
+index d96eaa3..b7f812d 100755
+--- a/tests/exec_tests.sh
++++ b/tests/exec_tests.sh
+@@ -33,6 +33,8 @@ fi
+
+ echo "-- Executing configuration tests"
+
++retval=0
++
+ for test in `ls -d ${TESTS}`; do
+ if [[ ! ${test} =~ ^..._ ]]; then
+ continue;
+@@ -55,14 +57,16 @@ for test in `ls -d ${TESTS}`; do
+
+ if [ $statusexec -ne 0 ]; then
+ echo -e "\e[31mNFT EXEC ERROR\e[0m"
++ retval=1
+ continue;
+ fi
+
+ #~ nftfile=`echo ${file} | awk -F'.' '{ print $1 }'`
+- $NFTBIN list ruleset > ${reportfile}
++ $NFTBIN list ruleset > ${reportfile} || retval=1
+
+ if [ ! -f ${outputfile} ]; then
+ echo "Dump file doesn't exist"
++ retval=1
+ continue;
+ fi
+
+@@ -74,6 +78,7 @@ for test in `ls -d ${TESTS}`; do
+ rm -f ${reportfile}
+ else
+ echo -e "\e[31mNFT DUMP ERROR\e[0m"
++ retval=1
+ fi
+ done
+
+@@ -83,4 +88,7 @@ fi
+
+ if [ "`grep 'nft command error' /var/log/syslog`" != "" ]; then
+ echo -e "\e[33m* command errors found, please check syslog\e[0m"
++ retval=1
+ fi
++
++exit ${retval}