From 1a62587a57d034681bd728b10b13a5ae5d7d2d4d Mon Sep 17 00:00:00 2001 From: Viacheslav Date: Sun, 15 Aug 2021 14:11:41 +0000 Subject: pbr: T3702: Fix incorrect splits for fwmark --- src/conf_mode/policy-local-route.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/conf_mode/policy-local-route.py') diff --git a/src/conf_mode/policy-local-route.py b/src/conf_mode/policy-local-route.py index 0b7ceedeb..539189442 100755 --- a/src/conf_mode/policy-local-route.py +++ b/src/conf_mode/policy-local-route.py @@ -114,15 +114,15 @@ def apply(pbr): # Only fwmark in the rule # set policy local-route rule 101 fwmark '23' if 'fwmark' in pbr['rule'][rule] and not 'source' in pbr['rule'][rule]: - for fwmk in pbr['rule'][rule]['fwmark']: - call(f'ip rule add prio {rule} from all fwmark {fwmk} lookup {table}') + fwmk = pbr['rule'][rule]['fwmark'] + call(f'ip rule add prio {rule} from all fwmark {fwmk} lookup {table}') # Source and fwmark in the rule # set policy local-route rule 100 source '203.0.113.1' # set policy local-route rule 100 fwmark '23' if 'source' in pbr['rule'][rule] and 'fwmark' in pbr['rule'][rule]: + fwmk = pbr['rule'][rule]['fwmark'] for src in pbr['rule'][rule]['source']: - for fwmk in pbr['rule'][rule]['fwmark']: - call(f'ip rule add prio {rule} from {src} fwmark {fwmk} lookup {table}') + call(f'ip rule add prio {rule} from {src} fwmark {fwmk} lookup {table}') return None -- cgit v1.2.3