diff options
Diffstat (limited to 'lib/routemap.c')
| -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 d080385fa1..22b4beb79d 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -1688,14 +1688,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; } } |
