diff options
-rw-r--r-- | nest/rt-show.c | 16 | ||||
-rw-r--r-- | proto/bgp/bgp.h | 3 |
2 files changed, 17 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); diff --git a/proto/bgp/bgp.h b/proto/bgp/bgp.h index b3966bc3..cca7873a 100644 --- a/proto/bgp/bgp.h +++ b/proto/bgp/bgp.h @@ -520,6 +520,9 @@ static inline int rte_resolvable(const rte *rt) { eattr *nhea = ea_find(rt->attrs, &ea_gen_nexthop); + if (!nhea) + return 0; + struct nexthop_adata *nhad = (void *) nhea->u.ptr; return NEXTHOP_IS_REACHABLE(nhad) || (nhad->dest != RTD_UNREACHABLE); } |