]> 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)
committerIgor Ryzhov <iryzhov@nfware.com>
Fri, 12 Nov 2021 16:32:06 +0000 (19:32 +0300)
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>
bgpd/bgp_bfd.c

index f23e6b2e9be9dbcb4bd18a5b3fe8033384506a88..ed54f42b0aa3a24a4a18f90951734d767974df0c 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;