diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2020-11-20 04:13:52 +0300 |
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2020-11-30 17:36:10 +0300 |
| commit | e285b70d3c802606cb7e9b6b18bcf9534168bc5d (patch) | |
| tree | bbded90c05b5b0f9549de5580b2097bcb4aa267a /ospf6d/ospf6_intra.c | |
| parent | 360d6f517ffc1e6598dff56ad046df2baa1be85f (diff) | |
ospf6: get instance from route table scope
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'ospf6d/ospf6_intra.c')
| -rw-r--r-- | ospf6d/ospf6_intra.c | 47 |
1 files changed, 21 insertions, 26 deletions
diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c index f84a7cfe9a..be5069c88d 100644 --- a/ospf6d/ospf6_intra.c +++ b/ospf6d/ospf6_intra.c @@ -987,7 +987,7 @@ int ospf6_intra_prefix_lsa_originate_stub(struct thread *thread) if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX)) zlog_debug(" include %pFX", &route->prefix); ospf6_route_add(ospf6_route_copy(route), - route_advertise, oa->ospf6); + route_advertise); } } @@ -1008,7 +1008,7 @@ int ospf6_intra_prefix_lsa_originate_stub(struct thread *thread) oa->lsdb); } } - ospf6_route_table_delete(route_advertise, oa->ospf6); + ospf6_route_table_delete(route_advertise); return 0; } @@ -1088,7 +1088,7 @@ int ospf6_intra_prefix_lsa_originate_stub(struct thread *thread) op = OSPF6_PREFIX_NEXT(op); } - ospf6_route_table_delete(route_advertise, oa->ospf6); + ospf6_route_table_delete(route_advertise); if (prefix_num == 0) { if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX)) @@ -1254,8 +1254,7 @@ int ospf6_intra_prefix_lsa_originate_transit(struct thread *thread) if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX)) zlog_debug(" include %pFX", &route->prefix); - ospf6_route_add(route, route_advertise, - oi->area->ospf6); + ospf6_route_add(route, route_advertise); prefix_num--; } if (current != end && IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX)) @@ -1277,7 +1276,7 @@ int ospf6_intra_prefix_lsa_originate_transit(struct thread *thread) prefix_num++; } - ospf6_route_table_delete(route_advertise, oi->area->ospf6); + ospf6_route_table_delete(route_advertise); if (prefix_num == 0) { if (IS_OSPF6_DEBUG_ORIGINATE(INTRA_PREFIX)) @@ -1438,7 +1437,7 @@ void ospf6_intra_prefix_route_ecmp_path(struct ospf6_area *oa, */ if (oa->route_table->hook_add) (*oa->route_table->hook_add)( - old_route, oa->ospf6); + old_route); if (old_route->path.origin.id == route->path.origin.id && @@ -1459,8 +1458,7 @@ void ospf6_intra_prefix_route_ecmp_path(struct ospf6_area *oa, } if (oa->route_table->hook_remove) ospf6_route_remove(old_route, - oa->route_table, - oa->ospf6); + oa->route_table); else SET_FLAG(old_route->flag, OSPF6_ROUTE_REMOVE); @@ -1601,8 +1599,7 @@ void ospf6_intra_prefix_route_ecmp_path(struct ospf6_area *oa, SET_FLAG(old_route->flag, OSPF6_ROUTE_ADD); /* Update ospf6 route table and RIB/FIB */ if (oa->route_table->hook_add) - (*oa->route_table->hook_add)(old_route, - oa->ospf6); + (*oa->route_table->hook_add)(old_route); /* Delete the new route its info added to existing * route. */ @@ -1614,7 +1611,7 @@ void ospf6_intra_prefix_route_ecmp_path(struct ospf6_area *oa, if (!route_found) { /* Add new route to existing node in ospf6 route table. */ - ospf6_route_add(route, oa->route_table, oa->ospf6); + ospf6_route_add(route, oa->route_table); } } @@ -1757,7 +1754,7 @@ void ospf6_intra_prefix_lsa_add(struct ospf6_lsa *lsa) listcount(route->paths), listcount(route->nh_list)); } - ospf6_route_add(route, oa->route_table, oa->ospf6); + ospf6_route_add(route, oa->route_table); } prefix_num--; } @@ -1839,7 +1836,7 @@ static void ospf6_intra_prefix_lsa_remove_update_route(struct ospf6_lsa *lsa, * nh_list */ if (oa->route_table->hook_add) - (*oa->route_table->hook_add)(route, oa->ospf6); + (*oa->route_table->hook_add)(route); /* route's primary path is similar * to LSA, replace route's primary @@ -1932,8 +1929,7 @@ void ospf6_intra_prefix_lsa_remove(struct ospf6_lsa *lsa) listcount(route->paths), listcount(route->nh_list)); } - ospf6_route_remove(route, oa->route_table, - oa->ospf6); + ospf6_route_remove(route, oa->route_table); } } if (route) @@ -1949,8 +1945,8 @@ void ospf6_intra_route_calculation(struct ospf6_area *oa) struct ospf6_route *route, *nroute; uint16_t type; struct ospf6_lsa *lsa; - void (*hook_add)(struct ospf6_route *, struct ospf6 *) = NULL; - void (*hook_remove)(struct ospf6_route *, struct ospf6 *) = NULL; + void (*hook_add)(struct ospf6_route *) = NULL; + void (*hook_remove)(struct ospf6_route *) = NULL; if (IS_OSPF6_DEBUG_EXAMIN(INTRA_PREFIX)) zlog_debug("Re-examin intra-routes for area %s", oa->name); @@ -1980,11 +1976,11 @@ void ospf6_intra_route_calculation(struct ospf6_area *oa) } if (CHECK_FLAG(route->flag, OSPF6_ROUTE_REMOVE)) - ospf6_route_remove(route, oa->route_table, oa->ospf6); + ospf6_route_remove(route, oa->route_table); else if (CHECK_FLAG(route->flag, OSPF6_ROUTE_ADD) || CHECK_FLAG(route->flag, OSPF6_ROUTE_CHANGE)) { if (hook_add) - (*hook_add)(route, oa->ospf6); + (*hook_add)(route); route->flag = 0; } else { /* Redo the summaries as things might have changed */ @@ -2056,8 +2052,8 @@ static void ospf6_brouter_debug_print(struct ospf6_route *brouter) void ospf6_intra_brouter_calculation(struct ospf6_area *oa) { struct ospf6_route *brouter, *nbrouter, *copy; - void (*hook_add)(struct ospf6_route *, struct ospf6 *) = NULL; - void (*hook_remove)(struct ospf6_route *, struct ospf6 *) = NULL; + void (*hook_add)(struct ospf6_route *) = NULL; + void (*hook_remove)(struct ospf6_route *) = NULL; uint32_t brouter_id; char brouter_name[16]; @@ -2115,7 +2111,7 @@ void ospf6_intra_brouter_calculation(struct ospf6_area *oa) copy = ospf6_route_copy(brouter); copy->type = OSPF6_DEST_TYPE_ROUTER; copy->path.area_id = oa->area_id; - ospf6_route_add(copy, oa->ospf6->brouter_table, oa->ospf6); + ospf6_route_add(copy, oa->ospf6->brouter_table); if (IS_OSPF6_DEBUG_BROUTER_SPECIFIC_ROUTER_ID(brouter_id) || IS_OSPF6_DEBUG_ROUTE(MEMORY)) { @@ -2201,8 +2197,7 @@ void ospf6_intra_brouter_calculation(struct ospf6_area *oa) * removes brouters which are marked for remove. */ oa->intra_brouter_calc = 1; - ospf6_route_remove(brouter, oa->ospf6->brouter_table, - oa->ospf6); + ospf6_route_remove(brouter, oa->ospf6->brouter_table); brouter = NULL; } else if (CHECK_FLAG(brouter->flag, OSPF6_ROUTE_ADD) || CHECK_FLAG(brouter->flag, OSPF6_ROUTE_CHANGE)) { @@ -2216,7 +2211,7 @@ void ospf6_intra_brouter_calculation(struct ospf6_area *oa) /* newly added */ if (hook_add) - (*hook_add)(brouter, oa->ospf6); + (*hook_add)(brouter); } else { if (IS_OSPF6_DEBUG_BROUTER_SPECIFIC_ROUTER_ID( brouter_id) |
