diff options
author | sarthurdev <965089+sarthurdev@users.noreply.github.com> | 2022-01-30 00:07:35 +0100 |
---|---|---|
committer | sarthurdev <965089+sarthurdev@users.noreply.github.com> | 2022-01-30 00:07:35 +0100 |
commit | 8532f2c391e895d7cd4c10b6d83d1e26973202a3 (patch) | |
tree | 63f859ee362a1b916ed0f7888bb4ae403042a0d2 /src/conf_mode/policy-route.py | |
parent | 985a9e8536cb7f049e82dd1c7333ecced34563fa (diff) | |
download | vyos-1x-8532f2c391e895d7cd4c10b6d83d1e26973202a3.tar.gz vyos-1x-8532f2c391e895d7cd4c10b6d83d1e26973202a3.zip |
policy: T4213: Fix duplicate commands from multiple rules with single table
Diffstat (limited to 'src/conf_mode/policy-route.py')
-rwxr-xr-x | src/conf_mode/policy-route.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/conf_mode/policy-route.py b/src/conf_mode/policy-route.py index 7dcab4b58..82f668acf 100755 --- a/src/conf_mode/policy-route.py +++ b/src/conf_mode/policy-route.py @@ -206,6 +206,7 @@ def apply_table_marks(policy): for route in ['route', 'route6']: if route in policy: cmd_str = 'ip' if route == 'route' else 'ip -6' + tables = [] for name, pol_conf in policy[route].items(): if 'rule' in pol_conf: for rule_id, rule_conf in pol_conf['rule'].items(): @@ -213,6 +214,9 @@ def apply_table_marks(policy): if set_table: if set_table == 'main': set_table = '254' + if set_table in tables: + continue + tables.append(set_table) table_mark = mark_offset - int(set_table) cmd(f'{cmd_str} rule add pref {set_table} fwmark {table_mark} table {set_table}') |