]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: withdraw fib entry on appropriate table identifier
authorPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 9 Jul 2019 08:59:14 +0000 (10:59 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 10 Oct 2019 14:06:51 +0000 (16:06 +0200)
There are cases where the table identifier is set on a bgp entry, mainly
due to route-map, and associate fib entry needs to be removed.
This change encompasses also the route-map reconfiguration that leads to
removing the previous entry, whereas bgp update had been triggered (
this happens when software inbound reconfiguration is handled).

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd/bgp_route.c
bgpd/bgp_zebra.c

index f0629fca089d82a4222596e0802c91337e14f200..3f30441f7be2a9161c15d7a2842090821e274998 100644 (file)
@@ -3165,6 +3165,13 @@ int bgp_update(struct peer *peer, struct prefix *p, uint32_t addpath_id,
                goto filtered;
        }
 
+       if (pi && pi->attr &&
+           pi->attr->rmap_table_id != new_attr.rmap_table_id) {
+               if (CHECK_FLAG(pi->flags, BGP_PATH_SELECTED))
+                       /* remove from RIB previous entry */
+                       bgp_zebra_withdraw(p, pi, bgp, safi);
+       }
+
        if (peer->sort == BGP_PEER_EBGP) {
 
                /* If we receive the graceful-shutdown community from an eBGP
index c9dd0f4bcbe5d39ff3b27e406424f9981933e012..7923f076c11906fa689192bf98bf424cd30e0c11 100644 (file)
@@ -1499,6 +1499,11 @@ void bgp_zebra_withdraw(struct prefix *p, struct bgp_path_info *info,
        api.safi = safi;
        api.prefix = *p;
 
+       if (info->attr->rmap_table_id) {
+               SET_FLAG(api.message, ZAPI_MESSAGE_TABLEID);
+               api.tableid = info->attr->rmap_table_id;
+       }
+
        /* If the route's source is EVPN, flag as such. */
        if (is_route_parent_evpn(info))
                SET_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE);