Skip to content

state_diff: fix filtering of host scoped routes#426

Merged
slyon merged 1 commit intocanonical:mainfrom
daniloegea:diff_route_filtering_fix
Jan 25, 2024
Merged

state_diff: fix filtering of host scoped routes#426
slyon merged 1 commit intocanonical:mainfrom
daniloegea:diff_route_filtering_fix

Conversation

@daniloegea
Copy link
Contributor

@daniloegea daniloegea commented Dec 6, 2023

When an interface has multiple IPs in the same subnet, there will be host scoped routes for each of them and the "src" address will be one of the IPs for all of them.

The filtering of this type of route was not working properly and including the extra routes in the diff.

This change generalizes the verification to see if the destination address is one of the system own addresses instead of comparing it with the src address.

While here, fix the data structure passed to the filtering method. It should be a list but a dictionary was being passed to it.

Description

Checklist

  • Runs make check successfully.
  • Retains 100% code coverage (make check-coverage).
  • New/changed keys in YAML format are documented.
  • (Optional) Adds example YAML for new feature.
  • (Optional) Closes an open bug in Launchpad.

When an interface has multiple IPs in the same subnet, there will be
host scoped routes for each of them and the "src" address will be one of
the IPs for all of them.

The filtering of this type of route was not working properly and
including the extra routes in the diff.

This change generalizes the verification to see if the destination
address is one of the system own addresses instead of comparing it with
the src address.

While here, fix the data structure passed to the filtering method. It
should be a list but a dictionary was being passed to it.
@daniloegea
Copy link
Contributor Author

@daniloegea daniloegea requested a review from slyon January 3, 2024 09:06
Copy link
Contributor

@slyon slyon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, in order to fix the current logic, passing a dict instead of a list.

But beware that in spec FO113 there's some discussion about the filtering of routes. So this logic might change in the future.

@slyon slyon merged commit ebb7480 into canonical:main Jan 25, 2024
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

Successfully merging this pull request may close these issues.

2 participants