ospf6d: originate AS-External LSAs with a forwarding address

Originate AS-External LSAs with forwarding addresses whenever the
corresponding redistributed routes have a global nexthop address.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
Renato Westphal 2023-03-02 20:20:39 -03:00
parent 48cdfc16dd
commit 73d9d322fe

View File

@ -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);