]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Generate RPKI CLI config even if no cache servers configured
authorDonatas Abraitis <donatas@opensourcerouting.org>
Mon, 20 Jun 2022 19:41:20 +0000 (22:41 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Mon, 20 Jun 2022 19:41:20 +0000 (22:41 +0300)
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 <donatas@opensourcerouting.org>
bgpd/bgp_rpki.c

index 913bf510c9d46b1b369ea3f1e2030fa889e20d35..0b3bef2d7d65fcc7196104d9f9cbcab18ed3f7c1 100644 (file)
@@ -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;
                }
        }