]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_route.c
Merge pull request #12458 from liron-ze/aggre-route-withdraw
[mirror_frr.git] / bgpd / bgp_route.c
index e478abc44a67df3fbbe3bb73e899c30a5fb0534c..4bb77b595245adb42ce2953de8916d03de57ffa8 100644 (file)
@@ -4407,6 +4407,12 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
                         * need to be imported again, so flag accordingly.
                         */
                        force_evpn_import = true;
+               } else {
+                       /* implicit withdraw, decrement aggregate and pcount
+                        * here. only if update is accepted, they'll increment
+                        * below.
+                        */
+                       bgp_aggregate_decrement(bgp, p, pi, afi, safi);
                }
 
                /* Received Logging. */
@@ -4427,11 +4433,6 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
                /* The attribute is changed. */
                bgp_path_info_set_flag(dest, pi, BGP_PATH_ATTR_CHANGED);
 
-               /* implicit withdraw, decrement aggregate and pcount here.
-                * only if update is accepted, they'll increment below.
-                */
-               bgp_aggregate_decrement(bgp, p, pi, afi, safi);
-
                /* Update bgp route dampening information.  */
                if (CHECK_FLAG(bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING)
                    && peer->sort == BGP_PEER_EBGP) {