summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_asbr.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospf6d/ospf6_asbr.c')
-rw-r--r--ospf6d/ospf6_asbr.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c
index 05275c52ea..b2cdbc9b57 100644
--- a/ospf6d/ospf6_asbr.c
+++ b/ospf6d/ospf6_asbr.c
@@ -1380,8 +1380,8 @@ ospf6_external_aggr_match(struct ospf6 *ospf6, struct prefix *p)
void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex,
struct prefix *prefix,
unsigned int nexthop_num,
- struct in6_addr *nexthop, route_tag_t tag,
- struct ospf6 *ospf6)
+ const struct in6_addr *nexthop,
+ route_tag_t tag, struct ospf6 *ospf6)
{
route_map_result_t ret;
struct ospf6_route troute;
@@ -1469,9 +1469,13 @@ void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex,
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);
@@ -1515,9 +1519,13 @@ void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex,
}
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);