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 <iryzhov@nfware.com>
This commit is contained in:
Igor Ryzhov 2021-11-12 19:32:06 +03:00
parent 4b80ea6252
commit 5b7586900a

View File

@ -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;