diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2025-03-26 14:35:13 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2025-03-26 14:35:13 -0400 |
| commit | d682f42d5b3c98da11a6647518b1e699363fd412 (patch) | |
| tree | cdebff27a3d1a202a34a8d0d02bcdf2af3d9ff4a /lib | |
| parent | 8ca4376e01a78075bc112b1c10717d3dc29fcae6 (diff) | |
lib: `show route-map` should not print (null)
This command:
route-map FOOBAR permit 10
set ipv6 next-hop prefer-global
set community 5060:12345 additive
!
When you issue a `show route-map ...` command displays this:
route-map: FOOBAR Invoked: 0 (0 milliseconds total) Optimization: enabled Processed Change: false
permit, sequence 5 Invoked 0 (0 milliseconds total)
Match clauses:
Set clauses:
ipv6 next-hop prefer-global (null)
community 5060:12345 additive
Call clause:
Action:
Exit routemap
Modify the code so that it no longer displays the NULL when there
is nothing to display.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/routemap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/routemap.c b/lib/routemap.c index 7aaa5d3be8..c68ab1ad20 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -1019,7 +1019,7 @@ static void vty_show_route_map_entry(struct vty *vty, struct route_map *map, char buf[BUFSIZ]; snprintf(buf, sizeof(buf), "%s %s", - rule->cmd->str, rule->rule_str); + rule->cmd->str, rule->rule_str ? rule->rule_str : ""); json_array_string_add(json_sets, buf); } @@ -1064,7 +1064,7 @@ static void vty_show_route_map_entry(struct vty *vty, struct route_map *map, for (rule = index->set_list.head; rule; rule = rule->next) vty_out(vty, " %s %s\n", rule->cmd->str, - rule->rule_str); + rule->rule_str ? rule->rule_str : ""); /* Call clause */ vty_out(vty, " Call clause:\n"); |
