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

state_diff: fix filtering of host scoped routes #426

Merged
merged 1 commit into from Jan 25, 2024

Conversation

daniloegea
Copy link
Collaborator

@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
Collaborator Author

This patch was integrated in this PPA https://launchpad.net/~danilogondolfo/+archive/ubuntu/netplan-diff/

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

@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
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants