From 73d9d322fe22c9e357fcc801562ab118f23c1969 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Thu, 2 Mar 2023 20:20:39 -0300 Subject: [PATCH] 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 --- ospf6d/ospf6_asbr.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index 05275c52ea..7ee22e05c7 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -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); -- 2.39.5