Page MenuHomeVyOS Platform

Policy local-route bug after migration to destination node address
Closed, ResolvedPublicBUG

Description

After the migration from policy local-route source|destination x.x.x.x to the node address policy local-route source|destination address x.x.x.x, there is a bug that can be reproduced in several commits and with several sources.

To reproduce, it needs to print a "call" for deleting rules after the second commit, https://github.com/vyos/vyos-1x/blob/3e4ea27ac21b163e00c03e21bf4bd8f9d19d99b6/src/conf_mode/policy-local-route.py#L207

Config to reproduce:

set policy local-route rule 100 destination address '203.0.113.5'
set policy local-route rule 100 fwmark '123456'
set policy local-route rule 100 set table '100'
set policy local-route rule 100 source address '203.0.113.1'
set policy local-route rule 100 source address '203.0.113.2'
commit


set policy local-route rule 100 source address '203.0.113.3'
commit

The first commit looks good, but the second commit is trying to delete rules for frmarks 1,2,3,4,5,6 instead of 123456:

vyos@r4# set policy local-route rule 100 source address '203.0.113.3'
[edit]
vyos@r4# commit
[ policy local-route ]
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: File exists
RTNETLINK answers: File exists
{'local_route': {'rule': {'100': {'destination': {'address': ['203.0.113.5']},
                                  'fwmark': '123456',
                                  'set': {'table': '100'},
                                  'source': {'address': ['203.0.113.1',
                                                         '203.0.113.2',
                                                         '203.0.113.3']}}}},
 'rule_remove': {'100': {'destination': {'address': ['203.0.113.5']},
                         'fwmark': '123456'}}}
DEBUG: ip rule del prio 100  to 203.0.113.5  fwmark 1 
DEBUG: ip rule del prio 100  to 203.0.113.5  fwmark 2 
DEBUG: ip rule del prio 100  to 203.0.113.5  fwmark 3 
DEBUG: ip rule del prio 100  to 203.0.113.5  fwmark 4 
DEBUG: ip rule del prio 100  to 203.0.113.5  fwmark 5 
DEBUG: ip rule del prio 100  to 203.0.113.5  fwmark 6 

DEBUG: ip rule add prio 100 from 203.0.113.1  to 203.0.113.5  fwmark 123456  lookup 100
DEBUG: ip rule add prio 100 from 203.0.113.2  to 203.0.113.5  fwmark 123456  lookup 100
DEBUG: ip rule add prio 100 from 203.0.113.3  to 203.0.113.5  fwmark 123456  lookup 100

But ip rule after commit looks good:

vyos@r4# ip rule
0:	from all lookup local
100:	from 203.0.113.1 to 203.0.113.5 fwmark 0x1e240 lookup 100
100:	from 203.0.113.2 to 203.0.113.5 fwmark 0x1e240 lookup 100
100:	from 203.0.113.3 to 203.0.113.5 fwmark 0x1e240 lookup 100
32766:	from all lookup main
32767:	from all lookup default
[edit]
vyos@r4#

We must fix it before implementing policy local-route source|destination port xxx

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

Viacheslav changed the subtype of this task from "Feature Request" to "Bug".