]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Do not reset peers on suppress-fib toggling
authorDonatas Abraitis <donatas@opensourcerouting.org>
Fri, 22 Nov 2024 08:30:37 +0000 (10:30 +0200)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Fri, 22 Nov 2024 08:30:37 +0000 (10:30 +0200)
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 <donatas@opensourcerouting.org>
bgpd/bgpd.c

index aa2bd5c3719c7b56d380f2221ca07827e826711c..d9d20563f91705c96b7dc4d38f9e7699db5e2c4e 100644 (file)
@@ -463,6 +463,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