Skip to content

Parse IPv6 next hops for IPv4 MP_REACH NLRI - #5

Merged
nuclearcat merged 1 commit into
mainfrom
fix/ipv4-ipv6-next-hop
Nov 17, 2026
Merged

nuclearcat merged 1 commit into
mainfrom
fix/ipv4-ipv6-next-hop

Conversation

@nuclearcat

@nuclearcat nuclearcat commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Accept the 16-byte IPv6 and 32-byte global/link-local next-hop forms for IPv4 unicast, multicast and labeled unicast, as specified by RFC 8950. Retain conventional IPv4 next hops and the existing encodings for other address families.

Cover next-hop length boundaries, truncated inputs, MP_REACH attribute ownership and UPDATE builder round trips, including ADD-PATH path IDs. Default and all-features test suites and Clippy pass; synthetic netom integration retains both IPv6 next-hop forms and marks the routes eligible with and without ADD-PATH.

Companion implementation: FastNetMon/netom#23. That PR pins this parser commit in Cargo.lock and adds BMP rebuilding, capability advertisement, and reconnect-dump coverage. Merge this routecore PR first, then the netom PR. If this PR is squash-merged or rebased, refresh netom's lockfile pin to the merged routecore revision before merging netom.

Related to FastNetMon/netom#22.

nuclearcat added a commit to nuclearcat/netom that referenced this pull request Nov 16, 2026
Keep 16-byte global and 32-byte global/link-local IPv6 next hops in
MP_REACH for IPv4 routes on the live rebuild and aggregated dump paths.
Advertise the matching Extended Next Hop tuple in both synthesized OPENs,
account for its headers when splitting dumps, and reserve room for the
OPEN optional-parameter header when adding descriptive capabilities.

Pin the routecore parser fix from FastNetMon/routecore#5 in Cargo.lock.
Keep capability warnings limited to tuples the output cannot reproduce.
Extend synthetic regressions and BMP end-to-end coverage for both IPv6
next-hop forms, including ADD-PATH and reconnect dumps.

Related to FastNetMon#22.
nuclearcat added a commit to nuclearcat/netom that referenced this pull request Nov 17, 2026
Keep 16-byte global and 32-byte global/link-local IPv6 next hops in
MP_REACH for IPv4 routes on the live rebuild and aggregated dump paths.
Advertise the matching Extended Next Hop tuple in both synthesized OPENs
for peers that advertised it (and for MRT sources, which carry no OPEN),
and account for its headers when splitting dumps.

Reserve room for the OPEN optional-parameter header when adding
descriptive and passed-through capabilities, so the Optional Parameters
Length octet can no longer wrap.

Pin the routecore parser fix from FastNetMon/routecore#5 in Cargo.lock.
Keep capability warnings limited to tuples the output cannot reproduce,
sharing the supported tuple with the encoder. Extend synthetic
regressions and BMP end-to-end coverage for both IPv6 next-hop forms,
including ADD-PATH and reconnect dumps.

Related to FastNetMon#22.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@nuclearcat
nuclearcat force-pushed the fix/ipv4-ipv6-next-hop branch from 7b26135 to 057edde Compare November 17, 2026 09:49
Accept the 16-byte IPv6 and 32-byte global/link-local next-hop forms for
IPv4 unicast, multicast and labeled unicast, and the RD-prefixed 24- and
48-byte forms for VPN-IPv4, as specified by RFC 8950. Retain conventional
IPv4 next hops.

Only accept these when the Extended Next Hop Encoding capability was
negotiated for the family: SessionConfig gains a strict family set, filled
from the capabilities both peers advertised when it is made from a
NegotiatedConfig. Standalone configs stay permissive for file parsing.
Add the OPEN helpers to advertise and read the capability, and let the
FSM advertise it via BgpConfig::extended_next_hop.

Share the length handling between address families. This also accepts the
32-byte form for IPv6 multicast and labeled unicast and the 48-byte form
for VPN-IPv6. The second address of a 32-byte next hop is only kept if it
is link-local; for the 48-byte form only the RD and global address are
kept.

Return NextHop::Unicast from NextHop::new for the multicast families, as
parsing does, so that a builder's default next hop round-trips.

Make set_nexthop_ll_addr work on builders for IPv4 families instead of
panicking, and return an error for next hops without a link-local part.

Cover next-hop length boundaries, truncated inputs, capability
enforcement, MP_REACH attribute ownership and UPDATE builder round trips
for unicast, multicast and labeled unicast, including ADD-PATH path IDs.

Related to FastNetMon/netom#22.
@nuclearcat
nuclearcat force-pushed the fix/ipv4-ipv6-next-hop branch from 057edde to 5cb8563 Compare November 17, 2026 11:50
@nuclearcat
nuclearcat merged commit d70c5d2 into main Nov 17, 2026
24 checks passed
nuclearcat added a commit to nuclearcat/netom that referenced this pull request Nov 17, 2026
Keep 16-byte global and 32-byte global/link-local IPv6 next hops in
MP_REACH for IPv4 routes on the live rebuild and aggregated dump paths.
Advertise the matching Extended Next Hop tuple in both synthesized OPENs
when the receiving side advertised it (and for MRT sources with no OPEN),
and account for its headers when splitting dumps.

Select mixed UPDATE next hops by both prefix and ADD-PATH identifier,
including during dump grouping and emission. Use the local OPEN for
inbound Extended Next Hop support and the remote OPEN for outbound
support. Cover asymmetric capabilities and same-prefix mixed updates
with synthetic regressions.

Reserve room for the OPEN optional-parameter header when adding
descriptive and passed-through capabilities, so the Optional Parameters
Length octet can no longer wrap.

Pin the routecore parser fix from FastNetMon/routecore#5 in Cargo.lock.
Keep capability warnings limited to tuples the output cannot reproduce,
sharing the supported tuple with the encoder. Extend synthetic
regressions and BMP end-to-end coverage for both IPv6 next-hop forms,
including ADD-PATH and reconnect dumps.

Related to FastNetMon#22.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.

1 participant