summaryrefslogtreecommitdiff
path: root/nest/rt-show.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2017-07-04 23:36:21 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2017-07-04 23:36:21 +0200
commita1f5e514ef091b82754f38f0e583af40778c7d97 (patch)
treeb449e8da19c061bb4a64857cf29cae9a521cf86f /nest/rt-show.c
parent5220cb63e34961b097d3bc274e394c0fa946d7d3 (diff)
Implement onlink flag for nexthops
Add proper support for per-nexthop onlink flag in routes to handle next hop addresses that are not covered by interface IP ranges. Supported by kernel and static protocols. Thanks to Vincent Bernat for the idea.
Diffstat (limited to 'nest/rt-show.c')
-rw-r--r--nest/rt-show.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/nest/rt-show.c b/nest/rt-show.c
index 3f5ef04d..afde2810 100644
--- a/nest/rt-show.c
+++ b/nest/rt-show.c
@@ -70,6 +70,7 @@ rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d, ea_list *tm
for (nh = &(a->nh); nh; nh = nh->next)
{
char mpls[MPLS_MAX_LABEL_STACK*12 + 5], *lsp = mpls;
+ char *onlink = (nh->flags & RNF_ONLINK) ? " onlink" : "";
if (nh->labels)
{
@@ -80,9 +81,11 @@ 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 weight %d", nh->gw, mpls, nh->iface->name, nh->weight + 1);
+ cli_printf(c, -1007, "\tvia %I%s on %s%s weight %d",
+ nh->gw, mpls, nh->iface->name, onlink, nh->weight + 1);
else
- cli_printf(c, -1007, "\tvia %I%s on %s", nh->gw, mpls, nh->iface->name);
+ cli_printf(c, -1007, "\tvia %I%s on %s%s",
+ nh->gw, mpls, nh->iface->name, onlink);
}
if (d->verbose)