summaryrefslogtreecommitdiff
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-05-19 17:40:45 -0700
committerDonald Sharp <sharpd@cumulusnetworks.com>2015-05-19 17:40:45 -0700
commit518f0eb1886d7f84194e31bc54ab9224f6e0b24a (patch)
tree628cecf3c5020f342aa0fef83d73514301600fcb /zebra/zebra_rib.c
parent244c1cdce553f6b722920ffe40a492ca230ad086 (diff)
bgpd: bgpd-event-driven-route-map-updates.patch
BGP: Reprocess the trigger points when an attached route map changes Currently, modifications to route maps do not affect already processed routes; they only affect new route updates. This patch addresses this limitation. Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index dac1166cbc..af04adaa49 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -930,9 +930,8 @@ nexthop_active_check (struct route_node *rn, struct rib *rib,
rib_table_info_t *info = rn->table->info;
struct interface *ifp;
route_map_result_t ret = RMAP_MATCH;
- extern char *proto_rm[AFI_MAX][ZEBRA_ROUTE_MAX+1];
- struct route_map *rmap;
int family;
+ char buf[INET6_ADDRSTRLEN+1];
family = 0;
switch (nexthop->type)
@@ -1021,18 +1020,17 @@ nexthop_active_check (struct route_node *rn, struct rib *rib,
if (!family)
family = info->afi;
- rmap = 0;
- if (rib->type >= 0 && rib->type < ZEBRA_ROUTE_MAX &&
- proto_rm[family][rib->type])
- rmap = route_map_lookup_by_name (proto_rm[family][rib->type]);
- if (!rmap && proto_rm[family][ZEBRA_ROUTE_MAX])
- rmap = route_map_lookup_by_name (proto_rm[family][ZEBRA_ROUTE_MAX]);
- if (rmap) {
- ret = route_map_apply(rmap, &rn->p, RMAP_ZEBRA, nexthop);
- }
-
+ ret = zebra_route_map_check(family, rib->type, &rn->p, nexthop);
if (ret == RMAP_DENYMATCH)
- UNSET_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE);
+ {
+ if (IS_ZEBRA_DEBUG_RIB)
+ {
+ inet_ntop (rn->p.family, &rn->p.u.prefix, buf, sizeof (buf));
+ zlog_debug("%s: Filtering out %s with NH out %s due to route map",
+ __FUNCTION__, buf, nexthop->ifname);
+ }
+ UNSET_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE);
+ }
return CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE);
}