little-dude / netlink

netlink libraries for rust
Other
329 stars 89 forks source link

next_hops: extend to support attributes other than just RTA_GATEWAY #234

Closed rshearman closed 2 years ago

rshearman commented 2 years ago

The NextHopBuffer used with RTA_MULTIPATH attributes can contain more than just RTA_GATEWAY - it can also currently contain RTA_VIA, RTA_FLOW, RTA_ENCAP and RTA_ENCAP_TYPE attributes, and more could be added in the future.

So extend the NextHop struct to store a Vec for all these other possible attributes, reusing the route Nla type, and emit and parse them accordingly.

This is unfortunately an API-breaking change, but is done in a way that limit breakages as much as possible.

rshearman commented 2 years ago

Pushed to fix build/test failures with rich_nlas target.

little-dude commented 2 years ago

Thanks @rshearman :)