diff options
Diffstat (limited to 'lib/routemap.c')
| -rw-r--r-- | lib/routemap.c | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/lib/routemap.c b/lib/routemap.c index e6310465e3..44d7185567 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -1059,7 +1059,6 @@ static int vty_show_route_map(struct vty *vty, const char *name, bool use_json) if (map) { vty_show_route_map_entry(vty, map, json_proto); - return CMD_SUCCESS; } else if (!use_json) { vty_out(vty, "%s: 'route-map %s' not found\n", frr_protonameinst, name); @@ -1816,7 +1815,24 @@ route_map_get_index(struct route_map *map, const struct prefix *prefix, struct route_map_index *index = NULL, *best_index = NULL; struct route_map_index *head_index = NULL; struct route_table *table = NULL; - unsigned char family = prefix->family; + struct prefix conv; + unsigned char family; + + /* + * Handling for matching evpn_routes in the prefix table. + * + * We convert type2/5 prefix to ipv4/6 prefix to do longest + * prefix matching on. + */ + if (prefix->family == AF_EVPN) { + if (evpn_prefix2prefix(prefix, &conv) != 0) + return NULL; + + prefix = &conv; + } + + + family = prefix->family; if (family == AF_INET) table = map->ipv4_prefix_table; @@ -1891,12 +1907,7 @@ route_map_get_index(struct route_map *map, const struct prefix *prefix, static int route_map_candidate_list_cmp(struct route_map_index *idx1, struct route_map_index *idx2) { - if (!idx1) - return -1; - if (!idx2) - return 1; - - return (idx1->pref - idx2->pref); + return idx1->pref - idx2->pref; } /* @@ -3175,6 +3186,12 @@ static struct cmd_node rmap_debug_node = { .config_write = rmap_config_write_debug, }; +void route_map_show_debug(struct vty *vty) +{ + if (rmap_debug) + vty_out(vty, "debug route-map\n"); +} + /* Configuration write function. */ static int rmap_config_write_debug(struct vty *vty) { |
