]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: automatically disable rpki when the last cache is removed instead of erroring out
authorMarcel Röthke <marcel.roethke@haw-hamburg.de>
Thu, 22 Aug 2019 14:55:04 +0000 (16:55 +0200)
committerMarcel Röthke <marcel.roethke@haw-hamburg.de>
Thu, 22 Aug 2019 15:39:00 +0000 (17:39 +0200)
Signed-off-by: Marcel Röthke <marcel.roethke@haw-hamburg.de>
bgpd/bgp_rpki.c

index b664f689972cf9d31d7f29142245db893dd017a8..d6335e33afecf0af830e38ff438e66d7fb15b331 100644 (file)
@@ -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;