diff options
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 24 |
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); } |
