|
|
21c891 |
From 236a8ea6f170dcab1484447b16d52d01c95b512f Mon Sep 17 00:00:00 2001
|
|
|
21c891 |
From: Eric Garver <e@erig.me>
|
|
|
21c891 |
Date: Thu, 20 Dec 2018 14:26:19 -0500
|
|
|
21c891 |
Subject: [PATCH 5/8] fw: enable RFC3964_IPv4 support
|
|
|
21c891 |
|
|
|
21c891 |
Actually call it and make it active now that both backends support it.
|
|
|
21c891 |
|
|
|
21c891 |
(cherry picked from commit 36139d2ae3fd9b0184d2b9668970c291d22276ce)
|
|
|
21c891 |
---
|
|
|
21c891 |
src/firewall/core/fw.py | 24 +++++++-----------------
|
|
|
21c891 |
1 file changed, 7 insertions(+), 17 deletions(-)
|
|
|
21c891 |
|
|
|
21c891 |
diff --git a/src/firewall/core/fw.py b/src/firewall/core/fw.py
|
|
|
21c891 |
index e8d77f11b2ae..a3089ce70eb8 100644
|
|
|
21c891 |
--- a/src/firewall/core/fw.py
|
|
|
21c891 |
+++ b/src/firewall/core/fw.py
|
|
|
21c891 |
@@ -817,24 +817,14 @@ class Firewall(object):
|
|
|
21c891 |
transaction.add_rules(backend, rules)
|
|
|
21c891 |
|
|
|
21c891 |
ipv6_backend = self.get_backend_by_ipv("ipv6")
|
|
|
21c891 |
- if self.ipv6_rpfilter_enabled and \
|
|
|
21c891 |
- "raw" in ipv6_backend.get_available_tables():
|
|
|
21c891 |
-
|
|
|
21c891 |
- # Execute existing transaction
|
|
|
21c891 |
- transaction.execute(True)
|
|
|
21c891 |
- # Start new transaction
|
|
|
21c891 |
- transaction.clear()
|
|
|
21c891 |
-
|
|
|
21c891 |
- rules = ipv6_backend.build_rpfilter_rules(self._log_denied)
|
|
|
21c891 |
- transaction.add_rules(ipv6_backend, rules)
|
|
|
21c891 |
+ if "raw" in ipv6_backend.get_available_tables():
|
|
|
21c891 |
+ if self.ipv6_rpfilter_enabled:
|
|
|
21c891 |
+ rules = ipv6_backend.build_rpfilter_rules(self._log_denied)
|
|
|
21c891 |
+ transaction.add_rules(ipv6_backend, rules)
|
|
|
21c891 |
|
|
|
21c891 |
- # Execute ipv6_rpfilter transaction, it might fail
|
|
|
21c891 |
- try:
|
|
|
21c891 |
- transaction.execute(True)
|
|
|
21c891 |
- except FirewallError as msg:
|
|
|
21c891 |
- log.warning("Applying rules for ipv6_rpfilter failed: %s", msg)
|
|
|
21c891 |
- # Start new transaction
|
|
|
21c891 |
- transaction.clear()
|
|
|
21c891 |
+ if self._rfc3964_ipv4:
|
|
|
21c891 |
+ rules = ipv6_backend.build_rfc3964_ipv4_rules()
|
|
|
21c891 |
+ transaction.add_rules(ipv6_backend, rules)
|
|
|
21c891 |
|
|
|
21c891 |
else:
|
|
|
21c891 |
if use_transaction is None:
|
|
|
21c891 |
--
|
|
|
21c891 |
2.18.0
|
|
|
21c891 |
|