From 745ae9c08822de29c609c49c3179ac5628b3ffc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20R=C3=B6thke?= Date: Thu, 7 Feb 2019 17:12:16 +0100 Subject: [PATCH 1/2] bgpd: fix "show rpki cache-server" for ssh caches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #3662 Signed-off-by: Marcel Röthke --- bgpd/bgp_rpki.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/bgpd/bgp_rpki.c b/bgpd/bgp_rpki.c index b614e87d23..b2e7f04ece 100644 --- a/bgpd/bgp_rpki.c +++ b/bgpd/bgp_rpki.c @@ -1190,9 +1190,23 @@ DEFUN (show_rpki_cache_server, struct cache *cache; for (ALL_LIST_ELEMENTS_RO(cache_list, cache_node, cache)) { - vty_out(vty, "host: %s port: %s\n", - cache->tr_config.tcp_config->host, - cache->tr_config.tcp_config->port); + if (cache->type == TCP) { + vty_out(vty, "host: %s port: %s\n", + cache->tr_config.tcp_config->host, + cache->tr_config.tcp_config->port); + + } else if (cache->type == SSH) { + vty_out(vty, + "host: %s port: %d username: %s " + "server_hostkey_path: %s client_privkey_path: %s\n", + cache->tr_config.ssh_config->host, + cache->tr_config.ssh_config->port, + cache->tr_config.ssh_config->username, + cache->tr_config.ssh_config + ->server_hostkey_path, + cache->tr_config.ssh_config + ->client_privkey_path); + } } return CMD_SUCCESS; From 222487feb59f3abbe7c5825bc66a4578fe6421a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20R=C3=B6thke?= Date: Thu, 7 Feb 2019 17:16:19 +0100 Subject: [PATCH 2/2] bgpd: fix crash when trying to remove non-existing rpki cache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Röthke --- bgpd/bgp_rpki.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgp_rpki.c b/bgpd/bgp_rpki.c index b2e7f04ece..a38d78916c 100644 --- a/bgpd/bgp_rpki.c +++ b/bgpd/bgp_rpki.c @@ -1134,7 +1134,7 @@ DEFPY (no_rpki_cache, { struct cache *cache_p = find_cache(preference); - if (!cache) { + if (!cache_p) { vty_out(vty, "Could not find cache %ld\n", preference); return CMD_WARNING; }