]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: ensure rpki cache preference values are unique even if rtr mgr is not yet started
authorMarcel Röthke <marcel.roethke@haw-hamburg.de>
Thu, 22 Aug 2019 13:48:05 +0000 (15:48 +0200)
committerMarcel Röthke <marcel.roethke@haw-hamburg.de>
Thu, 22 Aug 2019 15:30:51 +0000 (17:30 +0200)
Signed-off-by: Marcel Röthke <marcel.roethke@haw-hamburg.de>
bgpd/bgp_rpki.c

index 22840d54c6f8c0b908ea633ba0552a3ab532dc43..32f599745fe74755589680c3b9cea1f5765c681a 100644 (file)
@@ -1083,6 +1083,18 @@ DEFPY (rpki_cache,
        "Preference value\n")
 {
        int return_value;
+       struct listnode *cache_node;
+       struct cache *current_cache;
+
+       for (ALL_LIST_ELEMENTS_RO(cache_list, cache_node, current_cache)) {
+               if (current_cache->preference == preference) {
+                       vty_out(vty,
+                               "Cache with preference %ld is already configured\n",
+                               preference);
+                       return CMD_WARNING;
+               }
+       }
+
 
        // use ssh connection
        if (ssh_uname) {