From 284a6f5ff1312265b48699310b5a5bc6ecb10e1a Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 2 Oct 2020 07:18:58 -0400 Subject: [PATCH] lib: Keep track of route-map applications per section When the routemap code was rewritten for performance the code to track the number of times a particular section of a route-map was applied was not correctly updated. In this case I found another sequence of events where the number of times a section was invoked was not being correctly kept. Effectively in this case when route_map_get_index is called and returns an index the route map has been applied( see that skip_match_clause is set to true and then in the for loop below the skip_match_clause is tested and index->applied is incremented. Signed-off-by: Donald Sharp --- lib/routemap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/routemap.c b/lib/routemap.c index 1c2f43d968..360fd25cc9 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -2399,6 +2399,7 @@ route_map_result_t route_map_apply(struct route_map *map, index = route_map_get_index(map, prefix, object, (uint8_t *)&match_ret); if (index) { + index->applied++; if (rmap_debug) zlog_debug( "Best match route-map: %s, sequence: %d for pfx: %pFX, result: %s",