summaryrefslogtreecommitdiff
path: root/src/conf_mode/zone_policy.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-01-05 01:23:06 +0100
committerGitHub <noreply@github.com>2022-01-05 01:23:06 +0100
commit7eadd337bed031334629cfb29a6b5f69f88efe32 (patch)
tree77721249f1546d2a7face3913a76384bea5b6ab1 /src/conf_mode/zone_policy.py
parentf809139c04e5c18299a3b5929eb1c712a20a5535 (diff)
parent459c7079bebe7059d90441a5014d948a92d2ee19 (diff)
downloadvyos-1x-7eadd337bed031334629cfb29a6b5f69f88efe32.tar.gz
vyos-1x-7eadd337bed031334629cfb29a6b5f69f88efe32.zip
Merge pull request #1134 from sarthurdev/firewall
firewall: zone-policy: T2199: T4130: Fixes for firewall, state-policy and zone-policy
Diffstat (limited to 'src/conf_mode/zone_policy.py')
-rwxr-xr-xsrc/conf_mode/zone_policy.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/conf_mode/zone_policy.py b/src/conf_mode/zone_policy.py
index 2535ea33b..d605e9639 100755
--- a/src/conf_mode/zone_policy.py
+++ b/src/conf_mode/zone_policy.py
@@ -152,7 +152,9 @@ def cleanup_commands():
continue
for expr in item['rule']['expr']:
target = dict_search_args(expr, 'jump', 'target')
- if target and target.startswith("VZONE"):
+ if not target:
+ continue
+ if target.startswith("VZONE") or target.startswith("VYOS_STATE_POLICY"):
commands.append(f'delete rule {table} {chain} handle {handle}')
for item in obj['nftables']:
if 'chain' in item:
@@ -180,7 +182,7 @@ def generate(zone_policy):
def apply(zone_policy):
install_result = run(f'nft -f {nftables_conf}')
- if install_result == 1:
+ if install_result != 0:
raise ConfigError('Failed to apply zone-policy')
return None