mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 07:56:29 +00:00
Merge pull request #12937 from opensourcerouting/ospf6d-redist
ospf6d: small fixes in the handling of redistributed routes
This commit is contained in:
commit
334b1188c2
@ -1380,8 +1380,8 @@ ospf6_external_aggr_match(struct ospf6 *ospf6, struct prefix *p)
|
|||||||
void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex,
|
void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex,
|
||||||
struct prefix *prefix,
|
struct prefix *prefix,
|
||||||
unsigned int nexthop_num,
|
unsigned int nexthop_num,
|
||||||
struct in6_addr *nexthop, route_tag_t tag,
|
const struct in6_addr *nexthop,
|
||||||
struct ospf6 *ospf6)
|
route_tag_t tag, struct ospf6 *ospf6)
|
||||||
{
|
{
|
||||||
route_map_result_t ret;
|
route_map_result_t ret;
|
||||||
struct ospf6_route troute;
|
struct ospf6_route troute;
|
||||||
@ -1469,9 +1469,13 @@ void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex,
|
|||||||
|
|
||||||
info->type = type;
|
info->type = type;
|
||||||
|
|
||||||
if (nexthop_num && nexthop)
|
if (nexthop_num && nexthop) {
|
||||||
ospf6_route_add_nexthop(match, ifindex, 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);
|
ospf6_route_add_nexthop(match, ifindex, NULL);
|
||||||
|
|
||||||
match->path.origin.id = htonl(info->id);
|
match->path.origin.id = htonl(info->id);
|
||||||
@ -1515,9 +1519,13 @@ void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex,
|
|||||||
}
|
}
|
||||||
|
|
||||||
info->type = type;
|
info->type = type;
|
||||||
if (nexthop_num && nexthop)
|
if (nexthop_num && nexthop) {
|
||||||
ospf6_route_add_nexthop(route, ifindex, 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);
|
ospf6_route_add_nexthop(route, ifindex, NULL);
|
||||||
|
|
||||||
route = ospf6_route_add(route, ospf6->external_table);
|
route = ospf6_route_add(route, ospf6->external_table);
|
||||||
|
@ -114,7 +114,7 @@ extern int ospf6_asbr_is_asbr(struct ospf6 *o);
|
|||||||
extern void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex,
|
extern void ospf6_asbr_redistribute_add(int type, ifindex_t ifindex,
|
||||||
struct prefix *prefix,
|
struct prefix *prefix,
|
||||||
unsigned int nexthop_num,
|
unsigned int nexthop_num,
|
||||||
struct in6_addr *nexthop,
|
const struct in6_addr *nexthop,
|
||||||
route_tag_t tag, struct ospf6 *ospf6);
|
route_tag_t tag, struct ospf6 *ospf6);
|
||||||
extern void ospf6_asbr_redistribute_remove(int type, ifindex_t ifindex,
|
extern void ospf6_asbr_redistribute_remove(int type, ifindex_t ifindex,
|
||||||
struct prefix *prefix,
|
struct prefix *prefix,
|
||||||
|
@ -267,7 +267,8 @@ int ospf6_num_nexthops(struct list *nh_list)
|
|||||||
return (listcount(nh_list));
|
return (listcount(nh_list));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ospf6_add_nexthop(struct list *nh_list, int ifindex, struct in6_addr *addr)
|
void ospf6_add_nexthop(struct list *nh_list, int ifindex,
|
||||||
|
const struct in6_addr *addr)
|
||||||
{
|
{
|
||||||
struct ospf6_nexthop *nh;
|
struct ospf6_nexthop *nh;
|
||||||
struct ospf6_nexthop nh_match;
|
struct ospf6_nexthop nh_match;
|
||||||
|
@ -312,7 +312,7 @@ extern int ospf6_num_nexthops(struct list *nh_list);
|
|||||||
extern void ospf6_copy_nexthops(struct list *dst, struct list *src);
|
extern void ospf6_copy_nexthops(struct list *dst, struct list *src);
|
||||||
extern void ospf6_merge_nexthops(struct list *dst, struct list *src);
|
extern void ospf6_merge_nexthops(struct list *dst, struct list *src);
|
||||||
extern void ospf6_add_nexthop(struct list *nh_list, int ifindex,
|
extern void ospf6_add_nexthop(struct list *nh_list, int ifindex,
|
||||||
struct in6_addr *addr);
|
const struct in6_addr *addr);
|
||||||
extern void ospf6_add_route_nexthop_blackhole(struct ospf6_route *route);
|
extern void ospf6_add_route_nexthop_blackhole(struct ospf6_route *route);
|
||||||
extern int ospf6_num_nexthops(struct list *nh_list);
|
extern int ospf6_num_nexthops(struct list *nh_list);
|
||||||
extern bool ospf6_route_cmp_nexthops(struct ospf6_route *a,
|
extern bool ospf6_route_cmp_nexthops(struct ospf6_route *a,
|
||||||
|
@ -252,7 +252,7 @@ static int ospf6_zebra_read_route(ZAPI_CALLBACK_ARGS)
|
|||||||
{
|
{
|
||||||
struct zapi_route api;
|
struct zapi_route api;
|
||||||
unsigned long ifindex;
|
unsigned long ifindex;
|
||||||
struct in6_addr *nexthop;
|
const struct in6_addr *nexthop = &in6addr_any;
|
||||||
struct ospf6 *ospf6;
|
struct ospf6 *ospf6;
|
||||||
struct prefix_ipv6 p;
|
struct prefix_ipv6 p;
|
||||||
|
|
||||||
@ -272,7 +272,9 @@ static int ospf6_zebra_read_route(ZAPI_CALLBACK_ARGS)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ifindex = api.nexthops[0].ifindex;
|
ifindex = api.nexthops[0].ifindex;
|
||||||
nexthop = &api.nexthops[0].gate.ipv6;
|
if (api.nexthops[0].type == NEXTHOP_TYPE_IPV6
|
||||||
|
|| api.nexthops[0].type == NEXTHOP_TYPE_IPV6_IFINDEX)
|
||||||
|
nexthop = &api.nexthops[0].gate.ipv6;
|
||||||
|
|
||||||
if (IS_OSPF6_DEBUG_ZEBRA(RECV))
|
if (IS_OSPF6_DEBUG_ZEBRA(RECV))
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
|
Loading…
Reference in New Issue
Block a user