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

How do we create rtnl::routes::nla::NextHop when we use in our codes? #25

Open
terassyi opened this issue Feb 22, 2023 · 2 comments
Open

Comments

@terassyi
Copy link

When we want to add a route that has multiple paths, we have to use rtnl::route::nlas::NextHop struct from our codes.
However, we cannot directly initialize this struct, because this struct has #[non_exhaustive] attribute.

Is there any way to create rtnl::route::nlas::NextHop?

@jeff-hiner
Copy link
Contributor

I just hit something similar when trying to update from 0.13 to 0.15. A lot of structs are now marked #[non_exhaustive] but don't provide fn new or similar to create them. This makes it impossible to create RuleHeader, RuleMessage, and other structs necessary for changing routes. It also makes creating a NetlinkMessage unnecessarily more awkward.

Why was this marker added to these structs in the first place? Core parts like fib_rule_hdr don't have a paired size_t in the C ABI calls, and therefore aren't going to have fields added because it'd be a breaking ABI change.

@jeff-hiner
Copy link
Contributor

Caused by #11

jeff-hiner added a commit to jeff-hiner/netlink-packet-route that referenced this issue Mar 22, 2023
cjmakes pushed a commit to cjmakes/netlink-packet-route that referenced this issue Nov 17, 2023
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 a pull request may close this issue.

2 participants