summaryrefslogtreecommitdiff
path: root/nest/rt-show.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-06-08 11:47:49 +0200
committerMaria Matejka <mq@ucw.cz>2022-06-08 11:47:49 +0200
commitcae5979871ee7aa341334f8b1af6bafc60ee9692 (patch)
tree490f68c9c5d856ab560f2194fe350cd68039cccd /nest/rt-show.c
parent8fd3811d9d29d73570e03147eb024a4e5fde199b (diff)
parent950775f6fa3d569a9d7cd05e33538d35e895d688 (diff)
Merge commit '950775f6fa3d569a9d7cd05e33538d35e895d688' into haugesund
There were quite a lot of conflicts in flowspec validation code which ultimately led to some code being a bit rewritten, not only adapted from this or that branch, yet it is still in a limit of a merge.
Diffstat (limited to 'nest/rt-show.c')
-rw-r--r--nest/rt-show.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/nest/rt-show.c b/nest/rt-show.c
index 6cfd99fc..cc5a9a10 100644
--- a/nest/rt-show.c
+++ b/nest/rt-show.c
@@ -45,8 +45,11 @@ rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d, int primary
rta *a = e->attrs;
int sync_error = d->kernel ? krt_get_sync_error(d->kernel, e) : 0;
void (*get_route_info)(struct rte *, byte *buf);
- eattr *nhea = ea_find(a->eattrs, &ea_gen_nexthop);
+ eattr *nhea = net_type_match(e->net, NB_DEST) ?
+ ea_find(a->eattrs, &ea_gen_nexthop) : NULL;
struct nexthop_adata *nhad = nhea ? (struct nexthop_adata *) nhea->u.ptr : NULL;
+ int dest = nhad ? (NEXTHOP_IS_REACHABLE(nhad) ? RTD_UNICAST : nhad->dest) : RTD_NONE;
+ int flowspec_valid = net_is_flow(e->net) ? rt_get_flowspec_valid(e) : FLOWSPEC_UNKNOWN;
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 +71,11 @@ 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),
- e->src->proto->name, tm, from, primary ? (sync_error ? " !" : " *") : "", info);
+ 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),
+ 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;