Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent double route entries #6

Open
wungad opened this issue Aug 23, 2024 · 1 comment
Open

Prevent double route entries #6

wungad opened this issue Aug 23, 2024 · 1 comment
Assignees

Comments

@wungad
Copy link
Collaborator

wungad commented Aug 23, 2024

The routing plugin (initially) writes all active routes found on the system to the running datastore. All routes have a node named type with a value of ietf-routing:static. The plugin then updates the routing table by creating exact same routes but with proto static which is incorrect. There is an error present in the output while loading the plugin.

Routing table before:

$ ip ro
default via 172.27.29.254 dev net0 proto dhcp src 172.27.29.1 metric 100
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
172.27.29.0/24 dev net0 proto kernel scope link src 172.27.29.1 metric 100
172.27.29.254 dev net0 proto dhcp scope link src 172.27.29.1 metric 100
$ 

Error while loading:

[ERR] Invalid leafref value "net0" - no target instance "/if:interfaces/if:interface/if:name" with the same value. (Data location "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-routing:static'][name='unspec']/static-routes/ietf-ipv4-unicast-routing:ipv4/route[destination-prefix='172.27.29.254/32']/next-hop/next-hop-list/next-hop[index='index-0']/outgoing-interface".)
[ERR] Validation failed.
[ERR] ietf-routing-plugin: Unable to fill running Datastore, Possible error is matching interfaces in interfaces plugin, Err: Session::applyChanges: Couldn't apply changes: SR_ERR_VALIDATION_FAILED Invalid leafref value "net0" - no target instance "/if:interfaces/if:interface/if:name" with the same value. (Data location "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-routing:static'][name='unspec']/static-routes/ietf-ipv4-unicast-routing:ipv4/route[destination-prefix='172.27.29.254/32']/next-hop/next-hop-list/next-hop[index='index-0']/outgoing-interface".) (SR_ERR_LY) Validation failed. (SR_ERR_VALIDATION_FAILED)

Routing table after:

$ ip ro
default via 172.27.29.254 dev net0 proto static
default via 172.27.29.254 dev net0 proto dhcp src 172.27.29.1 metric 100
172.17.0.0/16 dev docker0 proto static linkdown
172.27.29.0/24 dev net0 proto static
172.27.29.0/24 dev net0 proto kernel scope link src 172.27.29.1 metric 100
172.27.29.254 dev net0 proto static
172.27.29.254 dev net0 proto dhcp scope link src 172.27.29.1 metric 100
@precla precla self-assigned this Jan 15, 2025
@precla
Copy link
Collaborator

precla commented Jan 16, 2025

The routing plugin (initially) writes all active routes found on the system to the running datastore. All routes have a node named type with a value of ietf-routing:static. The plugin then updates the routing table by creating exact same routes but with proto static which is incorrect. There is an error present in the output while loading the plugin.

Unfortunately i can not get it to set static routes with the same values as the dhcp and kernel route entries. To be more precise, it doesn't set anything from running ds to the system on my test setup. Nevertheless, can you try the routing plugin from this branch?

https://github.com/telekom/sysrepo-plugins/tree/prevent_double_route_entries_6

Error while loading:

[ERR] Invalid leafref value "net0" - no target instance "/if:interfaces/if:interface/if:name" with the same value. (Data location "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-routing:static'][name='unspec']/static-routes/ietf-ipv4-unicast-routing:ipv4/route[destination-prefix='172.27.29.254/32']/next-hop/next-hop-list/next-hop[index='index-0']/outgoing-interface".)
[ERR] Validation failed.
[ERR] ietf-routing-plugin: Unable to fill running Datastore, Possible error is matching interfaces in interfaces plugin, Err: Session::applyChanges: Couldn't apply changes: SR_ERR_VALIDATION_FAILED Invalid leafref value "net0" - no target instance "/if:interfaces/if:interface/if:name" with the same value. (Data location "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-routing:static'][name='unspec']/static-routes/ietf-ipv4-unicast-routing:ipv4/route[destination-prefix='172.27.29.254/32']/next-hop/next-hop-list/next-hop[index='index-0']/outgoing-interface".) (SR_ERR_LY) Validation failed. (SR_ERR_VALIDATION_FAILED)

this requires that you start the interfaces plugin once so it fills the interfaces running ds with the current interfaces of the system. After that you shouldn't see this error in the routing plugin once it's started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants