From 54d94f4b1a5b9d8f2943236323d789290bb7bb2f Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Thu, 16 Jun 2022 12:39:08 +0200 Subject: Showing the nexthop resolution target in import tables --- nest/rt-show.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'nest') diff --git a/nest/rt-show.c b/nest/rt-show.c index f3852d17..35036fe6 100644 --- a/nest/rt-show.c +++ b/nest/rt-show.c @@ -71,8 +71,13 @@ rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d, int primary if (d->last_table != d->tab) rt_show_table(c, d); - cli_printf(c, -1007, "%-20s %s [%s %s%s]%s%s", ia, - net_is_flow(e->net) ? flowspec_valid_name(flowspec_valid) : rta_dest_name(dest), + eattr *heea; + struct hostentry_adata *had = NULL; + if (!net_is_flow(e->net) && (dest == RTD_NONE) && (heea = ea_find(a, &ea_gen_hostentry))) + had = (struct hostentry_adata *) heea->u.ptr; + + cli_printf(c, -1007, "%-20s %s [%s %s%s]%s%s", ia, + net_is_flow(e->net) ? flowspec_valid_name(flowspec_valid) : had ? "recursive" : rta_dest_name(dest), e->src->proto->name, tm, from, primary ? (sync_error ? " !" : " *") : "", info); if (dest == RTD_UNICAST) @@ -100,6 +105,13 @@ rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d, int primary cli_printf(c, -1007, "\tdev %s%s%s", nh->iface->name, mpls, onlink, weight); } + else if (had) + { + if (ipa_nonzero(had->he->link) && !ipa_equal(had->he->link, had->he->addr)) + cli_printf(c, -1007, "\tvia %I %I table %s", had->he->addr, had->he->link, had->he->tab->name); + else + cli_printf(c, -1007, "\tvia %I table %s", had->he->addr, had->he->tab->name); + } if (d->verbose) ea_show_list(c, a); -- cgit v1.2.3