From 11423e50297c731166d3ae02f7f0c326eea36492 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Mon, 20 Jun 2022 22:41:20 +0300 Subject: [PATCH] bgpd: Generate RPKI CLI config even if no cache servers configured If we have more CLI options configured and the last cache server is removed, then the whole RPKI section is dropped. Signed-off-by: Donatas Abraitis --- bgpd/bgp_rpki.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/bgpd/bgp_rpki.c b/bgpd/bgp_rpki.c index 913bf510c9..0b3bef2d7d 100644 --- a/bgpd/bgp_rpki.c +++ b/bgpd/bgp_rpki.c @@ -1001,9 +1001,6 @@ static int config_write(struct vty *vty) struct listnode *cache_node; struct cache *cache; - if (!listcount(cache_list)) - return 0; - if (rpki_debug) vty_out(vty, "debug rpki\n"); @@ -1256,7 +1253,8 @@ DEFPY (no_rpki_cache, struct cache *cache_p = find_cache(preference); if (!cache_p) { - vty_out(vty, "Could not find cache %ld\n", preference); + vty_out(vty, "Could not find cache with preference %ld\n", + preference); return CMD_WARNING; } @@ -1264,9 +1262,9 @@ DEFPY (no_rpki_cache, stop(); } else if (is_running()) { if (rtr_mgr_remove_group(rtr_config, preference) == RTR_ERROR) { - vty_out(vty, "Could not remove cache %ld", preference); - - vty_out(vty, "\n"); + vty_out(vty, + "Could not remove cache with preference %ld\n", + preference); return CMD_WARNING; } } -- 2.39.5