From b34232cf863072d69e6b62a38c410f6c49db397d Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 3 Aug 2020 18:00:34 -0400 Subject: [PATCH 1/3] lib, tests: Add notation about whether or not a route-map is about to be reprocessed When you make a change to a route-map or a prefix-list it depends on, note that the route-map needs to be reprocessed for the change. Signed-off-by: Donald Sharp --- lib/routemap.c | 5 +++-- .../all-protocol-startup/r1/show_route_map.ref | 14 +++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/routemap.c b/lib/routemap.c index 22b4beb79d..639e7f63d2 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -821,9 +821,10 @@ static void vty_show_route_map_entry(struct vty *vty, struct route_map *map) struct route_map_index *index; struct route_map_rule *rule; - vty_out(vty, "route-map: %s Invoked: %" PRIu64 " Optimization: %s\n", + vty_out(vty, "route-map: %s Invoked: %" PRIu64 " Optimization: %s Processed Change: %s\n", map->name, map->applied - map->applied_clear, - map->optimization_disabled ? "disabled" : "enabled"); + map->optimization_disabled ? "disabled" : "enabled", + map->to_be_processed ? "true" : "false"); for (index = map->head; index; index = index->next) { vty_out(vty, " %s, sequence %d Invoked %" PRIu64 "\n", diff --git a/tests/topotests/all-protocol-startup/r1/show_route_map.ref b/tests/topotests/all-protocol-startup/r1/show_route_map.ref index 25786081d1..a0b7dda8f0 100644 --- a/tests/topotests/all-protocol-startup/r1/show_route_map.ref +++ b/tests/topotests/all-protocol-startup/r1/show_route_map.ref @@ -1,5 +1,5 @@ ZEBRA: -route-map: LIES Invoked: 0 Optimization: enabled +route-map: LIES Invoked: 0 Optimization: enabled Processed Change: false deny, sequence 10 Invoked 0 Match clauses: interface notpresent @@ -8,7 +8,7 @@ route-map: LIES Invoked: 0 Optimization: enabled Action: Exit routemap RIP: -route-map: LIES Invoked: 0 Optimization: enabled +route-map: LIES Invoked: 0 Optimization: enabled Processed Change: false deny, sequence 10 Invoked 0 Match clauses: interface notpresent @@ -17,7 +17,7 @@ route-map: LIES Invoked: 0 Optimization: enabled Action: Exit routemap RIPNG: -route-map: LIES Invoked: 0 Optimization: enabled +route-map: LIES Invoked: 0 Optimization: enabled Processed Change: false deny, sequence 10 Invoked 0 Match clauses: interface notpresent @@ -26,7 +26,7 @@ route-map: LIES Invoked: 0 Optimization: enabled Action: Exit routemap OSPF: -route-map: LIES Invoked: 0 Optimization: enabled +route-map: LIES Invoked: 0 Optimization: enabled Processed Change: false deny, sequence 10 Invoked 0 Match clauses: interface notpresent @@ -35,7 +35,7 @@ route-map: LIES Invoked: 0 Optimization: enabled Action: Exit routemap OSPF6: -route-map: LIES Invoked: 0 Optimization: enabled +route-map: LIES Invoked: 0 Optimization: enabled Processed Change: false deny, sequence 10 Invoked 0 Match clauses: interface notpresent @@ -44,7 +44,7 @@ route-map: LIES Invoked: 0 Optimization: enabled Action: Exit routemap BGP: -route-map: LIES Invoked: 0 Optimization: enabled +route-map: LIES Invoked: 0 Optimization: enabled Processed Change: false deny, sequence 10 Invoked 0 Match clauses: interface notpresent @@ -52,7 +52,7 @@ route-map: LIES Invoked: 0 Optimization: enabled Call clause: Action: Exit routemap -route-map: bgp-map Invoked: 0 Optimization: enabled +route-map: bgp-map Invoked: 0 Optimization: enabled Processed Change: false permit, sequence 10 Invoked 0 Match clauses: Set clauses: From 680b9b6258e6e867d4ef94d3d3e3f77790b24091 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 3 Aug 2020 18:06:05 -0400 Subject: [PATCH 2/3] lib: Allow `no call WORD` The `no call` cli was not accepting the original CLI as a quick cut-n-paste. This fixes that. Signed-off-by: Donald Sharp --- lib/routemap_cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routemap_cli.c b/lib/routemap_cli.c index 31bee1310e..10a958abed 100644 --- a/lib/routemap_cli.c +++ b/lib/routemap_cli.c @@ -948,7 +948,7 @@ DEFPY( DEFPY( no_rmap_call, no_rmap_call_cmd, - "no call", + "no call [NAME]", NO_STR "Jump to another Route-Map after match+set\n") { From 00aef028f683a01161bdeef0bac997230def488c Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 3 Aug 2020 18:15:29 -0400 Subject: [PATCH 3/3] lib: Put back applied count for route-maps The applied count for individual sub sections of route-maps was lost. Put it back. 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 639e7f63d2..df9a6a33ea 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -2413,6 +2413,7 @@ route_map_result_t route_map_apply(struct route_map *map, for (; index; index = index->next) { if (!skip_match_clause) { + index->applied++; /* Apply this index. */ match_ret = route_map_apply_match(&index->match_list, prefix, type, object);