fix(ris-live)!: parse comma-joined IPv6 global + link-local next hops - #339
Merged
Conversation
RIS Live projects MP_REACH_NLRI verbatim, so an RFC 2545 pair arrives
as one string ("2001:db8::1,fe80::1"). Announcement::next_hop (IpAddr)
failed to deserialise it, and the flattened RisMessage::msg Option
turned that into msg: None — the frame's routes silently dropped
(~20% of UPDATE frames: 15,706 of 77,075 in a 20s full-feed capture).
Behaviour changes in parse_ris_live_message:
- Comma-joined frames now yield elems, with the pair's global address
chosen by scope (a reversed pair still yields the global one).
- Unparseable next hops are Err(ElemIncorrectIp), not Ok(vec![]).
- The raw-bytes path and Nlri::next_hop_addr() share the same scope
resolution, so JSON and raw parsers agree.
Internals: NextHopAddress gains FromStr, global_addr(),
link_local_addr(), comma-joined Display for pairs. Regression fixtures
from captured frames in tests/fixtures/rislive/ (tests/rislive_frames.rs).
BREAKING CHANGE: Announcement::next_hop is now the verbatim wire String
(was IpAddr): deserialisation cannot fail, frames re-serialise
byte-for-byte. To recover the typed value:
let nh: NextHopAddress = announcement.next_hop.parse()?;
nh.global_addr() // the routable next hop (old field's value)
nh.link_local_addr() // Some(_) for a pair
Only affects code reading Announcement directly; the parse functions
and BgpElem are unchanged.
Assisted-by: Claude Code
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #339 +/- ##
==========================================
+ Coverage 91.37% 91.41% +0.04%
==========================================
Files 103 103
Lines 26237 26412 +175
==========================================
+ Hits 23973 24145 +172
- Misses 2264 2267 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The behavior is consistently implemented, documented, and covered by unit and captured-frame regression tests.
Pull request overview
Fixes silent RIS Live route loss when IPv6 next hops contain RFC 2545 global/link-local pairs.
Changes:
- Preserves verbatim RIS Live next-hop strings and resolves pairs by scope.
- Adds shared
NextHopAddressparsing/accessors and updates MRT/NLRI conversion. - Adds captured-frame regression and JSON/raw parity tests.
File summaries
| File | Description |
|---|---|
src/models/bgp/attributes/nlri.rs |
Uses scope-aware next-hop resolution. |
src/models/err.rs |
Adds next-hop parsing errors. |
src/models/network/nexthop.rs |
Adds pair parsing, rendering, and accessors. |
src/parser/mrt/mrt_elem.rs |
Resolves paired MRT next hops by scope. |
src/parser/rislive/messages/server/mod.rs |
Exports Announcement. |
src/parser/rislive/messages/server/ris_message.rs |
Stores next hops verbatim. |
src/parser/rislive/mod.rs |
Parses next hops during elem conversion. |
tests/fixtures/rislive/ris-live-frames.jsonl |
Adds captured RIS Live fixtures. |
tests/rislive_frames.rs |
Adds end-to-end regression coverage. |
CHANGELOG.md |
Documents fixes and breaking APIs. |
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
digizeph
approved these changes
Sep 10, 2026
digizeph
added a commit
that referenced
this pull request
Sep 10, 2026
Bump Cargo.toml and src/wasm/js/package.json to 0.22.0 and date the changelog section. Changelog sweep for the cycle: cite #333, #334 and #339 on their entries, add the missing #335 (ts-rs 11 -> 12) dependency entry, and credit @ties for #338 and #339 in a Contributors section. The cycle carries breaking changes (MSRV 1.88, Announcement::next_hop as the verbatim string, non-exhaustive error enums, parse_ris_live_message erroring on an unparsed body), so the cut is a minor bump: 0.21.0 to 0.22.0.
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.
RIS Live projects MP_REACH_NLRI verbatim, so an RFC 2545 pair arrives as one string ("2001:db8::1,fe80::1"). Announcement::next_hop (IpAddr) failed to deserialise it, and the flattened RisMessage::msg Option turned that into msg: None — the frame's routes silently dropped (~20% of UPDATE frames: 15,706 of 77,075 in a 20s full-feed capture).
Work done with Claude Code. Commit message consciously verbose so it describes the workaround and breaking change.