summaryrefslogtreecommitdiff
path: root/nest/rt-table.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-table.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-table.c')
-rw-r--r--nest/rt-table.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 85a951b8..2bb78cf2 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -1819,7 +1819,10 @@ no_nexthop:
}
}
if (ipa_nonzero(nh->gw))
- nhp->gw = nh->gw; /* Router nexthop */
+ {
+ nhp->gw = nh->gw; /* Router nexthop */
+ nhp->flags |= (nh->flags & RNF_ONLINK);
+ }
else if (ipa_nonzero(he->link))
nhp->gw = he->link; /* Device nexthop with link-local address known */
else