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

ncm-network: nmstate dgw fix #1656

Merged
merged 1 commit into from
Mar 19, 2024
Merged

ncm-network: nmstate dgw fix #1656

merged 1 commit into from
Mar 19, 2024

Conversation

aka7
Copy link
Contributor

@aka7 aka7 commented Feb 18, 2024

Fix for setting default gateway in nmstate with correct interface by looking up if gateway falls within subnet boundary.
next-hop-interface is mandatory for nmstate therefore figure out which interface subnet this gateway falls in.
This will provide backward compatibility with network.pm

closes #1655

  • Why the change is necessary.
    to provide backward compatibility with network.pm when setting default gateway. without having to set gateway address on interface.

  • What backwards incompatibility it may introduce.
    None.

@wdpypere
Copy link
Contributor

wdpypere commented Feb 19, 2024

@aka7 thanks for the quick work. I can confirm this code now does to default gateways what I would expect!

@aka7 aka7 force-pushed the nmstate_dgw_fix branch 2 times, most recently from da1e033 to a22b5f1 Compare February 20, 2024 12:33
@aka7 aka7 requested review from jrha, stdweird and wdpypere February 20, 2024 12:37
@aka7 aka7 marked this pull request as ready for review February 20, 2024 12:38
@aka7
Copy link
Contributor Author

aka7 commented Feb 20, 2024

@aka7 thanks for the quick work. I can confirm this code now does to default gateways what I would expect!

thanks for confirming, I've opened this PR for review now. I think this will be better then what I had before as I assumed every interface will have gateway defined.

Also bear in mind, nmstate module does not provide all functionalities currently provided by network.pm, as many of comments in the nmstate.pm states. @wdpypere

@aka7 aka7 changed the title Nmstate dgw fix ncm-network: nmstate dgw fix Feb 20, 2024
@stdweird
Copy link
Member

@aka7 can you also have a look at this?

@aka7 aka7 force-pushed the nmstate_dgw_fix branch 2 times, most recently from db9dc61 to bf69457 Compare March 19, 2024 11:16
nmstate requires next-hop-interface for every route to be added.
Create default route entry only on the interface if default_gateway falls within subnet boundary.

fixes quattor#1655
@aka7 aka7 force-pushed the nmstate_dgw_fix branch from bf69457 to 7d9bdfa Compare March 19, 2024 11:18
@stdweird stdweird merged commit ec386e7 into quattor:master Mar 19, 2024
2 checks passed
@jrha jrha added this to the 24.3 milestone Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

ncm-network: nmstate default gateway issue
4 participants