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

rtnl: removes non_exhaustive from NextHop structs. fixes #25 #61

Closed
wants to merge 1 commit into from

Conversation

cjmakes
Copy link

@cjmakes cjmakes commented Nov 17, 2023

Having these structs marked as non_exhaustive makes it impossible to construct a NextHop object. Constructing this object is useful for creating MultiPath routes which have multiple hops.

fixes #25

@cathay4t
Copy link
Member

Unlike NetlinkHeader, the kernel team might add new property to this struct, when it happens without non_exhaustive , this crate are forced to bump version from 1.x to 2.x which not acceptable for crate consumer.

If you have proof showing kernel will never change this struct, please state.

For constructing this object in your code, we can introduce Default treat or fn new() or From<> for this struct.

I am currently refactoring the code of route component, will take this into consideration.

@cathay4t
Copy link
Member

Without looking to kernel code deeply, I cannot tell the correct way of doing this. Stay tune for my conclusion on kernel code study.

@cathay4t
Copy link
Member

The content of NextHop is a group of netlink attributes, we should never expose it as NextHopBuffer. Will fix it in the coming refactor.

@cathay4t
Copy link
Member

@cjmakes I have create PR #64 which you can use RouteNextHop::default() to generate NextHop. It is not a single fixed size buffer, but could contains a list of netlink attributes.

@cathay4t cathay4t added the Wait_Submitter PR reviewed with change requests label Nov 27, 2023
@cathay4t
Copy link
Member

cathay4t commented Dec 6, 2023

The new release 0.18.1 has proper way to initialize a RouteNextHop

Closing. Feel free to reopen if you think further work required.

@cathay4t cathay4t closed this Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Wait_Submitter PR reviewed with change requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How do we create rtnl::routes::nla::NextHop when we use in our codes?
2 participants