Repository navigation
api: return next hops in ListPath paths - #630
Merged
Merged
Conversation
A full-table comparison with GoBGP turned up a visible CLI mismatch: `gobgp neighbor 172.30.77.2 adj-in 1.0.0.0/24` showed NEXT_HOP with GoBGP, but not RustyBGP. The binary API response was missing the same attribute. PathEntry's old comment said the next hop was already in the attributes used for API output. It isn't: UPDATE parsing extracts NEXT_HOP or MP_REACH into a separate value, while ListPath serialized only the remaining attributes. That split already existed when the comment was written. Keep the next hop separate in the RIB, as route distribution already does. Preserve the received value alongside the original attributes so Adj-RIB-In stays correct after import policy, then rebuild NEXT_HOP or MP_REACH when producing ListPath. Putting it back into stored attributes would create two sources of truth and risk encoding it twice. IPv4 and IPv6 tests cover structured and binary responses. With the same full table, GoBGP and RustyBGP now return matching route counts, binary attribute byte totals, and client byte checksums. Assisted-by: OpenAI Codex Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While benchmarking rustybgp with gobgp i noticed cli output mismatch, nexthop is missing (v4 and v6).
This patch restore feature parity.
Validated by same benchmarks and further real and synthetic testing.
Did you use an AI tool?
Assisted-by: OpenAI Codex
Fixes: #628