]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: fix bfd multihop
authorIgor Ryzhov <iryzhov@nfware.com>
Thu, 27 May 2021 17:02:56 +0000 (20:02 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Tue, 8 Jun 2021 17:50:29 +0000 (20:50 +0300)
Never send an interface name/index for multihop sessions. It breaks
"neighbor A.B.C.D update-source" config in BGP.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
bfdd/ptm_adapter.c
lib/bfd.c

index 4135e5fb493d2d6301872ad00d4ac87e11523ccc..838acf450fec934420f696aff0b26c490cdbbe14 100644 (file)
@@ -232,7 +232,7 @@ int ptm_bfd_notify(struct bfd_session *bs, uint8_t notify_state)
        stream_putl(msg, ZEBRA_INTERFACE_BFD_DEST_UPDATE);
 
        /* NOTE: Interface is a shortcut to avoid comparing source address. */
-       if (bs->ifp != NULL)
+       if (!CHECK_FLAG(bs->flags, BFD_SESS_FLAG_MH) && bs->ifp != NULL)
                stream_putl(msg, bs->ifp->ifindex);
        else
                stream_putl(msg, IFINDEX_INTERNAL);
index 4989188e4ee1311c39c73b7315eb3f986d290ab9..4327f7c28dd8ad16550c08002b5860be90d3631f 100644 (file)
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -314,9 +314,17 @@ int zclient_bfd_command(struct zclient *zc, struct bfd_session_arg *args)
        stream_putc(s, args->ttl);
 
        /* Send interface name if any. */
-       stream_putc(s, args->ifnamelen);
-       if (args->ifnamelen)
-               stream_put(s, args->ifname, args->ifnamelen);
+       if (args->mhop) {
+               /* Don't send interface. */
+               stream_putc(s, 0);
+               if (bsglobal.debugging && args->ifnamelen)
+                       zlog_debug("%s: multi hop is configured, not sending interface",
+                                  __func__);
+       } else {
+               stream_putc(s, args->ifnamelen);
+               if (args->ifnamelen)
+                       stream_put(s, args->ifname, args->ifnamelen);
+       }
 
        /* Send the C bit indicator. */
        stream_putc(s, args->cbit);