From b429c40f39ec739e375ec7f42a7d86c83c4b7026 Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Fri, 12 Nov 2021 19:32:06 +0300 Subject: [PATCH] bgpd: fix source-address for BFD sessions when using update-source IFNAME When "update-source IFNAME" is used for the neighbor, p->update_source is set to NULL, so we can't use it as a source address and should use the address from p->su_local. Signed-off-by: Igor Ryzhov (cherry picked from commit 5b7586900a0927e9d22907c86d6742bd3bd996b5) --- bgpd/bgp_bfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgp_bfd.c b/bgpd/bgp_bfd.c index b988a6f0f6..9861b5a907 100644 --- a/bgpd/bgp_bfd.c +++ b/bgpd/bgp_bfd.c @@ -163,7 +163,7 @@ void bgp_peer_bfd_update_source(struct peer *p) return; /* Figure out the correct source to use. */ - if (CHECK_FLAG(p->flags, PEER_FLAG_UPDATE_SOURCE)) + if (CHECK_FLAG(p->flags, PEER_FLAG_UPDATE_SOURCE) && p->update_source) source = p->update_source; else source = p->su_local; -- 2.39.5