From 393cb7619c1fcb52798c564acf68894242557889 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 f23e6b2e9b..ed54f42b0a 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