From 8add1719524bf2a8a450e9bcf5ec3a84ced5b384 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marcel=20R=C3=B6thke?= Date: Thu, 22 Aug 2019 16:55:04 +0200 Subject: [PATCH] bgpd: automatically disable rpki when the last cache is removed instead of erroring out MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Röthke --- bgpd/bgp_rpki.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bgpd/bgp_rpki.c b/bgpd/bgp_rpki.c index b664f68997..d6335e33af 100644 --- a/bgpd/bgp_rpki.c +++ b/bgpd/bgp_rpki.c @@ -1156,11 +1156,11 @@ DEFPY (no_rpki_cache, return CMD_WARNING; } - if (rtr_is_running) { + if (rtr_is_running && listcount(cache_list) == 1) { + stop(); + } else if (rtr_is_running) { if (rtr_mgr_remove_group(rtr_config, preference) == RTR_ERROR) { vty_out(vty, "Could not remove cache %ld", preference); - if (listcount(cache_list) == 1) - vty_out(vty, " because it is the last cache"); vty_out(vty, "\n"); return CMD_WARNING; -- 2.39.5