summaryrefslogtreecommitdiff
path: root/nest/rt-show.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2017-12-08 15:16:47 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2017-12-08 15:16:47 +0100
commiteb95b5ec1a5c3bd4e57f3a134828f8de2875cb43 (patch)
treeccad68d68297a1af27deadc23d15a97195ddcc4e /nest/rt-show.c
parent49c7ef3b21e51ae7d1969baa52b4d8fd29b22eeb (diff)
Nest: Minor formatting changes
Diffstat (limited to 'nest/rt-show.c')
-rw-r--r--nest/rt-show.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/nest/rt-show.c b/nest/rt-show.c
index 9989afa4..41a141a2 100644
--- a/nest/rt-show.c
+++ b/nest/rt-show.c
@@ -63,7 +63,7 @@ rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d, ea_list *tm
if (d->last_table != d->tab)
rt_show_table(c, d);
- cli_printf(c, -1007, "%-18s %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(a->dest),
a->src->proto->name, tm, from, primary ? (sync_error ? " !" : " *") : "", info);
if (a->dest == RTD_UNICAST)
@@ -71,6 +71,7 @@ rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d, ea_list *tm
{
char mpls[MPLS_MAX_LABEL_STACK*12 + 5], *lsp = mpls;
char *onlink = (nh->flags & RNF_ONLINK) ? " onlink" : "";
+ char weight[16] = "";
if (nh->labels)
{
@@ -81,11 +82,14 @@ rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d, ea_list *tm
*lsp = '\0';
if (a->nh.next)
- cli_printf(c, -1007, "\tvia %I%s on %s%s weight %d",
- nh->gw, mpls, nh->iface->name, onlink, nh->weight + 1);
+ bsprintf(weight, " weight %d", nh->weight + 1);
+
+ if (ipa_nonzero(nh->gw))
+ cli_printf(c, -1007, "\tvia %I on %s%s%s%s",
+ nh->gw, nh->iface->name, mpls, onlink, weight);
else
- cli_printf(c, -1007, "\tvia %I%s on %s%s",
- nh->gw, mpls, nh->iface->name, onlink);
+ cli_printf(c, -1007, "\tdev %s%s%s",
+ nh->iface->name, mpls, onlink, weight);
}
if (d->verbose)