diff options
| author | Chirag Shah <chirag@cumulusnetworks.com> | 2018-04-02 14:37:10 -0700 |
|---|---|---|
| committer | Chirag Shah <chirag@cumulusnetworks.com> | 2018-04-05 22:36:21 -0700 |
| commit | 03f3c1c101e8d035d01cf55ebadd1faa8791abf3 (patch) | |
| tree | f29c7fc84d514b670e6184f3428b59417d143b7f /ospf6d/ospf6_route.c | |
| parent | 0c842c46c79e1464a67b5aab3d644ab86f09c8ef (diff) | |
ospf6d: ECMP for Intra Area Prefix routes
Handle ECMP for Intra Area Prefix LSAs routes.
Ticket:CM-16139
Testing Done:
Configure ospf6 passive interface R2 and R3 with
same prefix address.
Check Intra Area Prefix LSA update at R1 and R3
which would have ECMP paths with effective two
paths and two nexthops (from R2 and R4).
stop frr at R3 and R1 and R4 route changes back to
one nexthop and one paht.
R1 ---- R2
| |
R3 ---- R4
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Diffstat (limited to 'ospf6d/ospf6_route.c')
| -rw-r--r-- | ospf6d/ospf6_route.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c index 67b9b9df96..8be00d9b41 100644 --- a/ospf6d/ospf6_route.c +++ b/ospf6d/ospf6_route.c @@ -382,6 +382,20 @@ struct ospf6_path *ospf6_path_dup(struct ospf6_path *path) return new; } +void ospf6_copy_paths(struct list *dst, struct list *src) +{ + struct ospf6_path *path_new, *path; + struct listnode *node; + + if (dst && src) { + for (ALL_LIST_ELEMENTS_RO(src, node, path)) { + path_new = ospf6_path_dup(path); + ospf6_copy_nexthops(path_new->nh_list, path->nh_list); + listnode_add_sort(dst, path_new); + } + } +} + struct ospf6_route *ospf6_route_create(void) { struct ospf6_route *route; @@ -420,6 +434,7 @@ struct ospf6_route *ospf6_route_copy(struct ospf6_route *route) new->linkstate_id = route->linkstate_id; new->path = route->path; ospf6_copy_nexthops(new->nh_list, route->nh_list); + ospf6_copy_paths(new->paths, route->paths); new->rnode = NULL; new->prev = NULL; new->next = NULL; @@ -649,10 +664,11 @@ struct ospf6_route *ospf6_route_add(struct ospf6_route *route, if (IS_OSPF6_DEBUG_ROUTE(MEMORY)) zlog_debug( - "%s %p: route add %p cost %u: update of %p old cost %u", + "%s %p: route add %p cost %u nh %u: update of %p old cost %u nh %u", ospf6_route_table_name(table), (void *)table, - (void *)route, route->path.cost, (void *)old, - old->path.cost); + (void *)route, route->path.cost, + listcount(route->nh_list), (void *)old, + old->path.cost, listcount(old->nh_list)); else if (IS_OSPF6_DEBUG_ROUTE(TABLE)) zlog_debug("%s: route add: update", ospf6_route_table_name(table)); |
