diff options
-rw-r--r-- | lib/routemap.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/routemap.c b/lib/routemap.c index 3d69a3495..b2bbdf865 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -1741,14 +1741,19 @@ route_map_get_index(struct route_map *map, const struct prefix *prefix, * more noops, we retain this return value and * return this eventually if there are no * matches. + * If a best match route-map index already + * exists, do not reset the match_ret. */ - if (*match_ret != RMAP_NOMATCH) + if (!best_index && (*match_ret != RMAP_NOMATCH)) *match_ret = ret; } else { /* * ret is RMAP_NOMATCH. + * If a best match route-map index already + * exists, do not reset the match_ret. */ - *match_ret = ret; + if (!best_index) + *match_ret = ret; } } |