summaryrefslogtreecommitdiffstats
path: root/ospf6d
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2023-03-03 00:20:39 +0100
committerRenato Westphal <renato@opensourcerouting.org>2023-03-02 23:38:03 +0100
commit73d9d322fe22c9e357fcc801562ab118f23c1969 (patch)
treea8218e0c54e557645ac871f295c281332a24ac0e /ospf6d
parentMerge pull request #12760 from opensourcerouting/fix/switch_to_pr_for_commitlint (diff)
downloadfrr-73d9d322fe22c9e357fcc801562ab118f23c1969.tar.xz
frr-73d9d322fe22c9e357fcc801562ab118f23c1969.zip
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>
Diffstat (limited to 'ospf6d')
-rw-r--r--ospf6d/ospf6_asbr.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c
index 05275c52e..7ee22e05c 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);