summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-02-22 07:53:48 +0100
committerChristian Poessinger <christian@poessinger.com>2022-02-22 07:53:48 +0100
commitff70406e3ba815ccc9c71c10e1be7f36774dac82 (patch)
tree9395a28dffc904855063d6aed8fcee7f15fd4012 /src
parentf73362462ea097757b7b8ed3a7338ef950160edc (diff)
downloadvyos-1x-ff70406e3ba815ccc9c71c10e1be7f36774dac82.tar.gz
vyos-1x-ff70406e3ba815ccc9c71c10e1be7f36774dac82.zip
Revert "backport: policy: T4151: Bugfix policy ipv6-local-route"
This reverts commit ed7c674da17519e6331a9cef8522c5e49251d505.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/policy-local-route.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/conf_mode/policy-local-route.py b/src/conf_mode/policy-local-route.py
index 1fcd3db2e..97ee6a785 100755
--- a/src/conf_mode/policy-local-route.py
+++ b/src/conf_mode/policy-local-route.py
@@ -121,14 +121,11 @@ def apply(pbr):
if rule_rm in pbr:
v6 = " -6" if rule_rm == 'rule6_remove' else ""
for rule, rule_config in pbr[rule_rm].items():
- rule_config['source'] = rule_config['source'] if 'source' in rule_config else ['']
- for src in rule_config['source']:
+ for src in (rule_config['source'] or ['']):
f_src = '' if src == '' else f' from {src} '
- rule_config['destination'] = rule_config['destination'] if 'destination' in rule_config else ['']
- for dst in rule_config['destination']:
+ for dst in (rule_config['destination'] or ['']):
f_dst = '' if dst == '' else f' to {dst} '
- rule_config['fwmark'] = rule_config['fwmark'] if 'fwmark' in rule_config else ['']
- for fwmk in rule_config['fwmark']:
+ for fwmk in (rule_config['fwmark'] or ['']):
f_fwmk = '' if fwmk == '' else f' fwmark {fwmk} '
call(f'ip{v6} rule del prio {rule} {f_src}{f_dst}{f_fwmk}')
@@ -144,11 +141,9 @@ def apply(pbr):
for rule, rule_config in pbr_route['rule'].items():
table = rule_config['set']['table']
- rule_config['source'] = rule_config['source'] if 'source' in rule_config else ['all']
- for src in rule_config['source'] or ['all']:
+ for src in (rule_config['source'] or ['all']):
f_src = '' if src == '' else f' from {src} '
- rule_config['destination'] = rule_config['destination'] if 'destination' in rule_config else ['all']
- for dst in rule_config['destination']:
+ for dst in (rule_config['destination'] or ['all']):
f_dst = '' if dst == '' else f' to {dst} '
f_fwmk = ''
if 'fwmark' in rule_config: