diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2017-08-22 00:43:43 +0200 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2017-08-24 01:25:45 +0200 |
commit | b30f3b91d4d91e5d58f2f999e2f673aeaf15d653 (patch) | |
tree | d021adecbd9e12f64135677091a513d0f270b366 /ospf6d/ospf6_route.c | |
parent | *: use zapi_route to send/receive redistributed routes as well (diff) | |
download | frr-b30f3b91d4d91e5d58f2f999e2f673aeaf15d653.tar.xz frr-b30f3b91d4d91e5d58f2f999e2f673aeaf15d653.zip |
ospf6d: fix regression detected by topotest
With the old API, ospf6d always needed to send a nexthop address and a
nexthop interface when advertising a route to zebra. In the case where
the nexthop address didn't exist (e.g. connected route), zebra would
take care of ignore it in the zread_ipv6_add() function.
Now, if we have a nexthop interface but not a nexthop address, we not
only can but we should send a nexthop of type NEXTHOP_TYPE_IFINDEX. zebra
won't fix bad nexthops anymore because the clients have a proper API to
send correct messages.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ospf6d/ospf6_route.c')
-rw-r--r-- | ospf6d/ospf6_route.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c index 03791ad7a..e58eab2b1 100644 --- a/ospf6d/ospf6_route.c +++ b/ospf6d/ospf6_route.c @@ -305,14 +305,16 @@ void ospf6_route_zebra_copy_nexthops(struct ospf6_route *route, zlog_debug(" nexthop: %s%%%.*s(%d)", buf, IFNAMSIZ, ifname, nh->ifindex); } - if (i < entries) { + if (i >= entries) + return; + + nexthops[i].ifindex = nh->ifindex; + if (!IN6_IS_ADDR_UNSPECIFIED(&nh->address)) { nexthops[i].gate.ipv6 = nh->address; - nexthops[i].ifindex = nh->ifindex; nexthops[i].type = NEXTHOP_TYPE_IPV6_IFINDEX; - i++; - } else { - return; - } + } else + nexthops[i].type = NEXTHOP_TYPE_IFINDEX; + i++; } } } |