From 87e2011c05a20cf257ebf18e95880af93e7fccc0 Mon Sep 17 00:00:00 2001 From: Keenan Tims Date: Thu, 22 Oct 2026 17:49:12 -0700 Subject: [PATCH] Send a control packet immediately on session state change RFC 5880 6.8.7 says a packet SHOULD be sent between periodic transmissions when its contents would change, so peers see state changes without waiting up to a full interval. --- src/bin/rust-bfdd.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bin/rust-bfdd.rs b/src/bin/rust-bfdd.rs index 28870ba..15ad371 100644 --- a/src/bin/rust-bfdd.rs +++ b/src/bin/rust-bfdd.rs @@ -545,6 +545,10 @@ impl BfdSession { _ => {} } self.state.set_session_state(new_state); + // https://datatracker.ietf.org/doc/html/rfc5880#section-6.8.7 + // A BFD Control packet SHOULD be transmitted during the interval between periodic Control packet + // transmissions when the contents of that packet would differ from that in the previously transmitted packet + self.transmit_control_packet(false).await; } async fn run(&mut self) {