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 <philippe.guibert@6wind.com>
This commit is contained in:
Philippe Guibert 2019-09-05 12:06:37 +02:00
parent bd32bb8058
commit b5b9dcae9c

View File

@ -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);