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