Commit bbd9240155 for frr
commit bbd9240155cb3e166020bd162075f1abcc7e1469
Merge: 2e28f6a4e9 1e5cfe86e9
Author: Rafael Zalamena <rzalamena@users.noreply.github.com>
Date: Tue Sep 15 11:51:53 2026 -0300
Merge pull request #23281 from w453y/bfdd-auth-seqnum
bfdd: make keyed SHA1 sequence number validation work
diff --cc bfdd/bfd.c
index bb8b270a45,b169d1c21e..90435930e4
--- a/bfdd/bfd.c
+++ b/bfdd/bfd.c
@@@ -263,24 -263,9 +263,18 @@@ void bfd_session_apply(struct bfd_sessi
else if (bs->profile && bs->profile->auth_config.key_chain_name[0] != '\0')
bs->kc = keychain_lookup(bs->profile->auth_config.key_chain_name);
- if (bs->peer_profile.auth_config.meticulous ||
- (bs->profile && bs->profile->auth_config.meticulous)) {
- bs->auth_meticulous = true;
- bs->auth_seq_num_update_modulo = AUTH_SEQ_NUM_MODULO_METICULOUS;
- } else {
- bs->auth_meticulous = false;
- bs->auth_seq_num_update_modulo = AUTH_SEQ_NUM_MODULO;
- }
+ bs->auth_meticulous = bs->peer_profile.auth_config.meticulous ||
+ (bs->profile && bs->profile->auth_config.meticulous);
+ /*
+ * Warn here rather than per packet. A keychain that holds nothing
+ * this session can use now keeps the session down instead of
+ * quietly running it unauthenticated, so say which keychain it was.
+ */
+ if (bs->kc && !bfd_keychain_key_find_active(bs->kc, bs->auth_meticulous))
+ zlog_warn("BFD: session [%s] has keychain %s but no key it can use; the session will not authenticate",
+ bs_to_string(bs), bs->kc->name);
+
/* If session interval changed negotiate new timers. */
if (bs->ses_state == PTM_BFD_UP &&
(bs->timers.desired_min_tx != min_tx || bs->timers.required_min_rx != min_rx)) {