]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospf6d: originate AS-External LSAs with a forwarding address
authorRenato Westphal <renato@opensourcerouting.org>
Thu, 2 Mar 2023 23:20:39 +0000 (20:20 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Thu, 2 Mar 2023 22:38:03 +0000 (19:38 -0300)
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>
ospf6d/ospf6_asbr.c

index 05275c52eaa94bbf0992d2fd137f564c77787913..7ee22e05c78e1a0e96f8501e052758de2a8116db 100644 (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);