Merge pull request #6736 from NaveenThanikachalam/rmap_noop

libfrr: Retain return value if the best index is found
This commit is contained in:
Russ White 2020-07-15 10:51:41 -04:00 committed by GitHub
commit 9a4dee5c35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1692,14 +1692,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;
}
}