info->type = type;
- if (nexthop_num && nexthop)
+ if (nexthop_num && nexthop) {
ospf6_route_add_nexthop(match, ifindex, nexthop);
- else
+ if (!IN6_IS_ADDR_UNSPECIFIED(nexthop)
+ && !IN6_IS_ADDR_LINKLOCAL(nexthop))
+ memcpy(&info->forwarding, nexthop,
+ sizeof(struct in6_addr));
+ } else
ospf6_route_add_nexthop(match, ifindex, NULL);
match->path.origin.id = htonl(info->id);
}
info->type = type;
- if (nexthop_num && nexthop)
+ if (nexthop_num && nexthop) {
ospf6_route_add_nexthop(route, ifindex, nexthop);
- else
+ if (!IN6_IS_ADDR_UNSPECIFIED(nexthop)
+ && !IN6_IS_ADDR_LINKLOCAL(nexthop))
+ memcpy(&info->forwarding, nexthop,
+ sizeof(struct in6_addr));
+ } else
ospf6_route_add_nexthop(route, ifindex, NULL);
route = ospf6_route_add(route, ospf6->external_table);