Hi,
attached are two patches against master (2.20.0): a BIRD patch adding a
runtime "gshut" command, and a bird-tools patch with a netlab case
(cf-ebgp-gshut) plus a small command helper. This is the RFC 8326 item
on the roadmap.
gshut [off] <protocol> | "<pattern>" | all
While active, routes exported to the selected BGP peers carry the
GRACEFUL_SHUTDOWN community (65535,0). Toggling triggers a refeed and
does not touch the session. The state shows in "show protocols all".
For running instances it survives configuration-driven replacement,
including restart and disable. Sessions spawned by a dynamic listener
inherit its state; existing ones stay separately selectable.
This covers the outbound signalling of RFC 8326. Import policy and the
eventual session shutdown stay with the operator.
The netlab case checks, as seen on the peers: community added, an
existing community preserved, state kept across a restarting
reconfiguration, inheritance by a newly spawned dynamic session, and
removal with "gshut off". Reference data was recorded with 2.20.0 plus
the patch (data-v2.20): save 28 passed, check 23 passed, 5 skipped
(save-only waits). AddressSanitizer runs of the suite, of config
disable followed by CLI enable, and of replacing a drained BGP instance
by a same-name static one and back, were clean.
One documented limitation: an instance that is already down loses the
flag when replaced by reconfiguration, since that path calls no BGP
hook.
Two questions:
1. Would you want this covered by a small nest-level state hand-over
hook, or is the documented limitation acceptable for now?
2. Is "gshut" the name you want for the command?
The patches were developed with LLM assistance; I have reviewed and
tested every change. Daemon commit for reference:
Thanks,
Andreas Scholdan