summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2020-07-15 16:51:41 +0200
committerGitHub <noreply@github.com>2020-07-15 16:51:41 +0200
commit9a4dee5c3534c298d439eb6e4b6e45e89f66d4da (patch)
tree587079128695ad9e43c9e1eca96eedeee40a33c3 /lib
parentMerge pull request #6740 from FRRouting/revert-5015-rpki_vrf_encapsulation (diff)
parentlibfrr: Retain ret value if the best idx is found (diff)
downloadfrr-9a4dee5c3534c298d439eb6e4b6e45e89f66d4da.tar.xz
frr-9a4dee5c3534c298d439eb6e4b6e45e89f66d4da.zip
Merge pull request #6736 from NaveenThanikachalam/rmap_noop
libfrr: Retain return value if the best index is found
Diffstat (limited to 'lib')
-rw-r--r--lib/routemap.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/routemap.c b/lib/routemap.c
index 7749ea4cc..1415a9e2e 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -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;
}
}