From 02d922c6b19a243da300aa64505585fe40f15722 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 557a64cf53d5..bb218cf12141 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -461,6 +461,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