From 665ec41339659bef7f643c6df7aab034be0523ed Mon Sep 17 00:00:00 2001 From: zmw12306 Date: Sun, 7 Apr 2024 16:19:38 -0400 Subject: [PATCH] bfdd: add check for flag M Signed-off-by: zmw12306 --- bfdd/bfd.h | 2 ++ bfdd/bfd_packet.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/bfdd/bfd.h b/bfdd/bfd.h index 5451e66c23df..c6dc0d613714 100644 --- a/bfdd/bfd.h +++ b/bfdd/bfd.h @@ -89,6 +89,8 @@ struct bfd_echo_pkt { #define BFD_CBIT 0x08 #define BFD_ABIT 0x04 #define BFD_DEMANDBIT 0x02 +#define BFD_MBIT 0x01 +#define BFD_GETMBIT(flags) (flags & BFD_MBIT) #define BFD_SETDEMANDBIT(flags, val) \ { \ if ((val)) \ diff --git a/bfdd/bfd_packet.c b/bfdd/bfd_packet.c index 311ce4d37905..dadf9c25d756 100644 --- a/bfdd/bfd_packet.c +++ b/bfdd/bfd_packet.c @@ -862,6 +862,12 @@ void bfd_recv_cb(struct event *t) return; } + if (BFD_GETMBIT(cp->flags)) { + cp_debug(is_mhop, &peer, &local, ifindex, vrfid, + "detect non-zero Multipoint (M) flag"); + return; + } + if (cp->discrs.my_discr == 0) { cp_debug(is_mhop, &peer, &local, ifindex, vrfid, "'my discriminator' is zero");