Blame SOURCES/0094-fix-tests-functions-add-macro-HOST_SUPPORTS_IPV6.patch

136e2c
From 5d6a4644993589429e39a3f54234dc9fe67e79f2 Mon Sep 17 00:00:00 2001
136e2c
From: Eric Garver <eric@garver.life>
136e2c
Date: Tue, 27 Aug 2019 12:49:22 -0400
136e2c
Subject: [PATCH 94/99] fix: tests/functions: add macro HOST_SUPPORTS_IPV6
136e2c
136e2c
Check for the ipv6 sysctls to see if IPv6 is available. While nftables
136e2c
allows addidng ip6 rules even if ipv6 is disabled, firewalld will also
136e2c
try to set some sysctls which fail.
136e2c
136e2c
(cherry picked from commit f9ede55708e3cb325c1052b7c68f3346c8c8c63f)
136e2c
(cherry picked from commit 49d9856b39be6b07aff4dcaa8682752cb8782de4)
136e2c
---
136e2c
 src/tests/functions.at | 8 ++++++++
136e2c
 1 file changed, 8 insertions(+)
136e2c
136e2c
diff --git a/src/tests/functions.at b/src/tests/functions.at
136e2c
index 571f780a007c..07ad3668ec5f 100644
136e2c
--- a/src/tests/functions.at
136e2c
+++ b/src/tests/functions.at
136e2c
@@ -421,6 +421,14 @@ m4_define([HOST_SUPPORTS_IP6TABLES], m4_esyscmd(
136e2c
     fi
136e2c
 ))
136e2c
 
136e2c
+m4_define([HOST_SUPPORTS_IPV6], m4_esyscmd(
136e2c
+    if sysctl -a |grep -F "net.ipv6" >/dev/null 2>&1; then
136e2c
+        echo -n "yes"
136e2c
+    else
136e2c
+        echo -n "no"
136e2c
+    fi
136e2c
+))
136e2c
+
136e2c
 m4_define([IF_IPV6_SUPPORTED], [
136e2c
     m4_ifdef([TESTING_FIREWALL_OFFLINE_CMD], [$1], [
136e2c
     m4_if(nftables, FIREWALL_BACKEND, [$1], [
136e2c
-- 
136e2c
2.20.1
136e2c