From a2ed7b2b182f5adb3d90babbcbb07e8c0ad03ffa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marcel=20R=C3=B6thke?= Date: Thu, 22 Aug 2019 15:48:05 +0200 Subject: [PATCH] bgpd: ensure rpki cache preference values are unique even if rtr mgr is not yet started MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Röthke --- bgpd/bgp_rpki.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bgpd/bgp_rpki.c b/bgpd/bgp_rpki.c index 22840d54c6..32f599745f 100644 --- a/bgpd/bgp_rpki.c +++ b/bgpd/bgp_rpki.c @@ -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) { -- 2.39.5