diff options
author | Maria Matejka <mq@ucw.cz> | 2022-06-16 12:39:08 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-06-16 12:39:08 +0200 |
commit | 54d94f4b1a5b9d8f2943236323d789290bb7bb2f (patch) | |
tree | f245ff5de196415b52caae6e006888b0157f6c0f /nest | |
parent | 4364ee9b6f3764c971ab111bf7dc87477fd7272c (diff) |
Showing the nexthop resolution target in import tables
Diffstat (limited to 'nest')
-rw-r--r-- | nest/rt-show.c | 16 |
1 files changed, 14 insertions, 2 deletions
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); |