summaryrefslogtreecommitdiffstats
path: root/staticd/static_zebra.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-01-27 02:44:42 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-01-27 03:02:26 +0100
commitfe85601c961738e8867a7f2411054dcf4e34d0c3 (patch)
treec301a84803cda9e8e69b791debbd2f1b4bcdf30f /staticd/static_zebra.c
parentMerge pull request #3614 from donaldsharp/connected_route_cost_fixes (diff)
downloadfrr-fe85601c961738e8867a7f2411054dcf4e34d0c3.tar.xz
frr-fe85601c961738e8867a7f2411054dcf4e34d0c3.zip
*: The onlink attribute should be owned by the nexthop not the route.
The onlink attribute was being passed from upper level protocols as an attribute of the route *not* the individual nexthop. When we pass this data to the kernel, we treat the onlink as a attribute of the nexthop. This commit modifies the code base to allow us to pass the ONLINK attribute as an attribute of the nexthop. This commit also fixes static routes that have multiple nexthops some onlink and some not. ip route 4.5.6.7/32 192.168.41.1 eveth1 onlink ip route 4.5.6.7/32 192.168.42.2 S>* 4.5.6.7/32 [1/0] via 192.168.41.1, eveth1 onlink, 00:03:04 * via 192.168.42.2, eveth2, 00:03:04 sharpd@robot ~/frr2> sudo ip netns exec EVA ip route show 4.5.6.7 proto 196 metric 20 nexthop via 192.168.41.1 dev eveth1 weight 1 onlink nexthop via 192.168.42.2 dev eveth2 weight 1 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'staticd/static_zebra.c')
-rw-r--r--staticd/static_zebra.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/staticd/static_zebra.c b/staticd/static_zebra.c
index d6db60d3e..3f3117752 100644
--- a/staticd/static_zebra.c
+++ b/staticd/static_zebra.c
@@ -370,8 +370,6 @@ extern void static_zebra_route_add(struct route_node *rn,
memcpy(&api.src_prefix, src_pp, sizeof(api.src_prefix));
}
SET_FLAG(api.flags, ZEBRA_FLAG_RR_USE_DISTANCE);
- if (si_changed->onlink)
- SET_FLAG(api.flags, ZEBRA_FLAG_ONLINK);
SET_FLAG(api.message, ZAPI_MESSAGE_NEXTHOP);
if (si_changed->distance) {
SET_FLAG(api.message, ZAPI_MESSAGE_DISTANCE);
@@ -397,6 +395,8 @@ extern void static_zebra_route_add(struct route_node *rn,
continue;
api_nh->vrf_id = si->nh_vrf_id;
+ api_nh->onlink = si->onlink;
+
switch (si->type) {
case STATIC_IFNAME:
if (si->ifindex == IFINDEX_INTERNAL)