diff options
author | Maria Matejka <mq@ucw.cz> | 2022-05-15 18:09:30 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-05-30 14:39:09 +0200 |
commit | 950775f6fa3d569a9d7cd05e33538d35e895d688 (patch) | |
tree | 81b4b23d5695e209301b252d0d282b05a0d67ac1 /nest/rt-show.c | |
parent | 4fe9881d625f10e44109a649e369a413bd98de71 (diff) |
Route destination field merged with nexthop attribute; splitting flowspec validation result out.
As there is either a nexthop or another destination specification
(or othing in case of ROAs and Flowspec), it may be merged together.
This code is somehow quirky and should be replaced in future by better
implementation of nexthop.
Also flowspec validation result has its own attribute now as it doesn't
have anything to do with route nexthop.
Diffstat (limited to 'nest/rt-show.c')
-rw-r--r-- | nest/rt-show.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/nest/rt-show.c b/nest/rt-show.c index 32f7aa2d..0ad8f5c6 100644 --- a/nest/rt-show.c +++ b/nest/rt-show.c @@ -47,6 +47,7 @@ rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d, int primary void (*get_route_info)(struct rte *, byte *buf); eattr *nhea = ea_find(a->eattrs, &ea_gen_nexthop); struct nexthop_adata *nhad = nhea ? (struct nexthop_adata *) nhea->u.ptr : NULL; + int dest = NEXTHOP_IS_REACHABLE(nhad) ? RTD_UNICAST : nhad->dest; tm_format_time(tm, &config->tf_route, e->lastmod); ip_addr a_from = ea_get_ip(a->eattrs, &ea_gen_from, IPA_NONE); @@ -68,10 +69,10 @@ 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, rta_dest_name(a->dest), + cli_printf(c, -1007, "%-20s %s [%s %s%s]%s%s", ia, rta_dest_name(dest), e->src->proto->name, tm, from, primary ? (sync_error ? " !" : " *") : "", info); - if (a->dest == RTD_UNICAST) + if (dest == RTD_UNICAST) NEXTHOP_WALK(nh, nhad) { char mpls[MPLS_MAX_LABEL_STACK*12 + 5], *lsp = mpls; |