]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: fix source-address for BFD sessions when using update-source IFNAME
authorIgor Ryzhov <iryzhov@nfware.com>
Fri, 12 Nov 2021 16:32:06 +0000 (19:32 +0300)
committermergify-bot <noreply@mergify.io>
Mon, 15 Nov 2021 15:34:02 +0000 (15:34 +0000)
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>
(cherry picked from commit 5b7586900a0927e9d22907c86d6742bd3bd996b5)

bgpd/bgp_bfd.c

index b988a6f0f628a325968b5db4c8e799e396923f80..9861b5a907a5af73046d59e2797cc9ed788d7d88 100644 (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;