Skip to content

Conversation

@cpaasch-oai
Copy link
Contributor

The goal of this PR is to support pushing a rtnl_nh down to the kernel through netlink, similar to what ip nexthop add does.

A few additional things in this PR (1 bugfix, some more tests for getters/setters and adding support for ENETDOWN). Let me know if I should split it in separate PRs - I don't want to create overhead for you @thom311 .

f4d68e9 adds an extensive testsuite for the rtnl_nh getters/setters. All in user-space. As part of adding this work, one bug was identified (fixed with 87c7af1).

79d1abd adds another error-code for ENETDOWN, which turned out to be useful when testing the kernel round-trip for rtnl_nh_add.

933edc3 actually adds the rtnl_nh_add() call.

c46fa32 tries to be a complete test-suite for the rtnl_nh_add() call as well as fetching nexthop objects (and parsing the netlink message) from the kernel.

For improved error-output.

Signed-off-by: Christoph Paasch <[email protected]>
Test as much as possible, positive and negative conditions.

Signed-off-by: Christoph Paasch <[email protected]>
This allows to push the nexthop to the kernel. Similar to
`ip nexthop add` command.

Signed-off-by: Christoph Paasch <[email protected]>
We want to test whether rtnl_nh_add generates the right netlink messages
and whether querying the kernel is able to properly parse the netlink
messages. Thus, do a kernel-roundtrip.

Signed-off-by: Christoph Paasch <[email protected]>
@thom311 thom311 merged commit b4a6d1e into thom311:main Aug 6, 2025
4 checks passed
@thom311
Copy link
Owner

thom311 commented Aug 6, 2025

thank you for all the tests. This is really nice!!

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 this pull request may close these issues.

2 participants