From f62baf6ca9a023494e57bf0509b279e2b3e8d1c6 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Fri, 22 Nov 2024 10:30:37 +0200 Subject: [PATCH] bgpd: Do not reset peers on suppress-fib toggling If the desired state is the same - do nothing instead of resetting once again. Fixes: bdb5ae8bce94432eb5e581f04f48dc4aa5db7ca4 ("bgpd: Make suppress-fib-pending clear peering") Signed-off-by: Donatas Abraitis (cherry picked from commit 7fb4c03f5b1c9cd4e8acb85b4cf953ac85aa0bbf) --- bgpd/bgpd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 5818381809b0..d65aac672c1d 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -462,6 +462,10 @@ void bgp_suppress_fib_pending_set(struct bgp *bgp, bool set) if (bgp->inst_type == BGP_INSTANCE_TYPE_VIEW) return; + /* Do nothing if already in a desired state */ + if (set == !!CHECK_FLAG(bgp->flags, BGP_FLAG_SUPPRESS_FIB_PENDING)) + return; + if (set) { SET_FLAG(bgp->flags, BGP_FLAG_SUPPRESS_FIB_PENDING); /* Send msg to zebra for the first instance of bgp enabled