Skip to content

Fix gr#358

Merged
fujita merged 2 commits into
osrg:masterfrom
fujita:fix-gr
May 19, 2026
Merged

Fix gr#358
fujita merged 2 commits into
osrg:masterfrom
fujita:fix-gr

Conversation

@fujita
Copy link
Copy Markdown
Member

@fujita fujita commented May 19, 2026

No description provided.

fujita added 2 commits May 19, 2026 13:00
Per-family Source objects make it possible to identify routes by
(remote_addr, family) alone, without passing Arc<Source> through
the event layer.  This change exploits that to eliminate the stale
source tracking map (gr_source / DisconnectInfo::source) and
simplify the whole GR plumbing.

TableEvent::Disconnected and MarkStale now carry (IpAddr, Family)
instead of Arc<Source>.  RoutingTable::drop() and restale() take
the same pair.  The helper functions gr_drop_source, gr_restale_source,
and drain_stale_sources are gone; replaced by gr_drop_families,
gr_drop_stale_families, and gr_restale_families.

A new RoutingTable::drop_stale(addr, family) removes only stale paths,
leaving fresh routes from a reconnected session intact.  It is used
for EOR receipt and deferral-timer expiry where the peer may have
already sent fresh routes; gr_restart_timer_expired keeps using drop()
because the peer has not yet reconnected at that point.

PeerContext::gr_source removed.  Timer callbacks receive addr as a
plain argument captured at spawn time from PeerSession::remote_addr,
so no need to store it in PeerContext.  handle_advertise switches from
Arc::ptr_eq to remote_addr equality, which also correctly filters
routes from previous sessions of the same peer.

Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
…s active

When a peer disconnects with GR negotiated, the previous code skipped
route removal entirely for all families.  Non-GR families should be
dropped right away just like a normal disconnect; only the GR-capable
families are preserved as stale.

Introduce families_to_drop_on_disconnect() to compute which families to
drop, and call it unconditionally in session_loop.  GR families are
excluded from the drop set; every other session family is dropped via
Disconnected(addr, family) as before.

Add unit tests for the helper and functional tests that verify routing
table state after the drop events are applied.

Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
@fujita fujita merged commit 499571e into osrg:master May 19, 2026
3 checks passed
@fujita fujita deleted the fix-gr branch May 19, 2026 04:23
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