|
|
843f86 |
From f80a02d760b1810bb5a3021aabb78ed20f5e629d Mon Sep 17 00:00:00 2001
|
|
|
843f86 |
From: Thomas Woerner <twoerner@redhat.com>
|
|
|
843f86 |
Date: Mon, 22 May 2017 17:56:41 +0200
|
|
|
843f86 |
Subject: [PATCH 2/6] firewall.core.fw: Get NAT helpers and store them
|
|
|
843f86 |
internally.
|
|
|
843f86 |
|
|
|
843f86 |
The NAT helpers are stored internally to be able to use them in zones with the
|
|
|
843f86 |
conntrack helpers.
|
|
|
843f86 |
|
|
|
843f86 |
This is needed for RHBZ#1452681
|
|
|
843f86 |
|
|
|
843f86 |
(cherry picked from commit f0109e044e5601fba20d42db24c25e8e8cf804a0)
|
|
|
843f86 |
---
|
|
|
843f86 |
src/firewall/core/fw.py | 11 +++++++++++
|
|
|
843f86 |
1 file changed, 11 insertions(+)
|
|
|
843f86 |
|
|
|
843f86 |
diff --git a/src/firewall/core/fw.py b/src/firewall/core/fw.py
|
|
|
843f86 |
index 8dbe59b6e3b5..4db856c4e17d 100644
|
|
|
843f86 |
--- a/src/firewall/core/fw.py
|
|
|
843f86 |
+++ b/src/firewall/core/fw.py
|
|
|
843f86 |
@@ -114,6 +114,7 @@ class Firewall(object):
|
|
|
843f86 |
self._automatic_helpers = config.FALLBACK_AUTOMATIC_HELPERS
|
|
|
843f86 |
self.nf_conntrack_helper_setting = 0
|
|
|
843f86 |
self.nf_conntrack_helpers = { }
|
|
|
843f86 |
+ self.nf_nat_helpers = { }
|
|
|
843f86 |
|
|
|
843f86 |
def individual_calls(self):
|
|
|
843f86 |
return self._individual_calls
|
|
|
843f86 |
@@ -203,8 +204,18 @@ class Firewall(object):
|
|
|
843f86 |
log.debug1(" %s: %s", key, ", ".join(values))
|
|
|
843f86 |
else:
|
|
|
843f86 |
log.debug1("No conntrack helpers supported by the kernel.")
|
|
|
843f86 |
+
|
|
|
843f86 |
+ self.nf_nat_helpers = functions.get_nf_nat_helpers()
|
|
|
843f86 |
+ if len(self.nf_nat_helpers) > 0:
|
|
|
843f86 |
+ log.debug1("NAT helpers supported by the kernel:")
|
|
|
843f86 |
+ for key,values in self.nf_nat_helpers.items():
|
|
|
843f86 |
+ log.debug1(" %s: %s", key, ", ".join(values))
|
|
|
843f86 |
+ else:
|
|
|
843f86 |
+ log.debug1("No NAT helpers supported by the kernel.")
|
|
|
843f86 |
+
|
|
|
843f86 |
else:
|
|
|
843f86 |
self.nf_conntrack_helpers = { }
|
|
|
843f86 |
+ self.nf_nat_helpers = { }
|
|
|
843f86 |
log.warning("modinfo command is missing, not able to detect conntrack helpers.")
|
|
|
843f86 |
|
|
|
843f86 |
def _start(self, reload=False, complete_reload=False):
|
|
|
843f86 |
--
|
|
|
843f86 |
2.12.0
|
|
|
843f86 |
|