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.
This commit is contained in:
ktims committed 2026-10-22 17:49:12 -07:00
1 parent 0c19b955f9
commit 87e2011c05
1 file changed
+4
+4
View File
@@ -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) {