From b5b9dcae9c2429cd205e4ec498065f3b38a053c5 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Thu, 5 Sep 2019 12:06:37 +0200 Subject: [PATCH] bgpd: avoid crash when calling show rpki-table if ssh cache servers are configured, then show rpki-table is looking at the tcp server context. Fix this by checking the server cache type, and also display the ssh context if this is configured. Signed-off-by: Philippe Guibert --- bgpd/bgp_rpki.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bgpd/bgp_rpki.c b/bgpd/bgp_rpki.c index d62ad3e922..6ead123dcb 100644 --- a/bgpd/bgp_rpki.c +++ b/bgpd/bgp_rpki.c @@ -1242,9 +1242,14 @@ DEFUN (show_rpki_prefix_table, 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 + vty_out(vty, "host: %s port: %u SSH\n", + cache->tr_config.ssh_config->host, + cache->tr_config.ssh_config->port); } if (is_synchronized()) print_prefix_table(vty);