summaryrefslogtreecommitdiff
path: root/staticd/static_routes.c
diff options
context:
space:
mode:
Diffstat (limited to 'staticd/static_routes.c')
-rw-r--r--staticd/static_routes.c71
1 files changed, 4 insertions, 67 deletions
diff --git a/staticd/static_routes.c b/staticd/static_routes.c
index cba38183bb..cbe1c3c8c0 100644
--- a/staticd/static_routes.c
+++ b/staticd/static_routes.c
@@ -33,10 +33,6 @@ void zebra_stable_node_cleanup(struct route_table *table,
struct static_nexthop *nh;
struct static_path *pn;
struct static_route_info *si;
- struct route_table *src_table;
- struct route_node *src_node;
- struct static_path *src_pn;
- struct static_route_info *src_si;
si = node->info;
@@ -50,36 +46,6 @@ void zebra_stable_node_cleanup(struct route_table *table,
static_path_list_del(&si->path_list, pn);
XFREE(MTYPE_STATIC_PATH, pn);
}
-
- /* clean up for dst table */
- src_table = srcdest_srcnode_table(node);
- if (src_table) {
- /* This means the route_node is part of the top
- * hierarchy and refers to a destination prefix.
- */
- for (src_node = route_top(src_table); src_node;
- src_node = route_next(src_node)) {
- src_si = src_node->info;
-
- frr_each_safe(static_path_list,
- &src_si->path_list, src_pn) {
- frr_each_safe(static_nexthop_list,
- &src_pn->nexthop_list,
- nh) {
- static_nexthop_list_del(
- &src_pn->nexthop_list,
- nh);
- XFREE(MTYPE_STATIC_NEXTHOP, nh);
- }
- static_path_list_del(&src_si->path_list,
- src_pn);
- XFREE(MTYPE_STATIC_PATH, src_pn);
- }
-
- XFREE(MTYPE_STATIC_ROUTE, src_node->info);
- }
- }
-
XFREE(MTYPE_STATIC_ROUTE, node->info);
}
}
@@ -124,28 +90,10 @@ struct route_node *static_add_route(afi_t afi, safi_t safi, struct prefix *p,
return rn;
}
-/* To delete the srcnodes */
-static void static_del_src_route(struct route_node *rn)
-{
- struct static_path *pn;
- struct static_route_info *si;
-
- si = rn->info;
-
- frr_each_safe(static_path_list, &si->path_list, pn) {
- static_del_path(pn);
- }
-
- XFREE(MTYPE_STATIC_ROUTE, rn->info);
- route_unlock_node(rn);
-}
-
void static_del_route(struct route_node *rn)
{
struct static_path *pn;
struct static_route_info *si;
- struct route_table *src_table;
- struct route_node *src_node;
si = rn->info;
@@ -153,17 +101,6 @@ void static_del_route(struct route_node *rn)
static_del_path(pn);
}
- /* clean up for dst table */
- src_table = srcdest_srcnode_table(rn);
- if (src_table) {
- /* This means the route_node is part of the top hierarchy
- * and refers to a destination prefix.
- */
- for (src_node = route_top(src_table); src_node;
- src_node = route_next(src_node)) {
- static_del_src_route(src_node);
- }
- }
XFREE(MTYPE_STATIC_ROUTE, rn->info);
route_unlock_node(rn);
}
@@ -477,7 +414,7 @@ static void static_fixup_vrf(struct vrf *vrf, struct route_table *stable,
struct static_path *pn;
struct static_route_info *si;
- for (rn = route_top(stable); rn; rn = route_next(rn)) {
+ for (rn = route_top(stable); rn; rn = srcdest_route_next(rn)) {
si = static_route_info_from_rnode(rn);
if (!si)
continue;
@@ -517,7 +454,7 @@ static void static_enable_vrf(struct route_table *stable, afi_t afi, safi_t safi
struct static_path *pn;
struct static_route_info *si;
- for (rn = route_top(stable); rn; rn = route_next(rn)) {
+ for (rn = route_top(stable); rn; rn = srcdest_route_next(rn)) {
si = static_route_info_from_rnode(rn);
if (!si)
continue;
@@ -575,7 +512,7 @@ static void static_cleanup_vrf(struct vrf *vrf, struct route_table *stable,
struct static_path *pn;
struct static_route_info *si;
- for (rn = route_top(stable); rn; rn = route_next(rn)) {
+ for (rn = route_top(stable); rn; rn = srcdest_route_next(rn)) {
si = static_route_info_from_rnode(rn);
if (!si)
continue;
@@ -608,7 +545,7 @@ static void static_disable_vrf(struct route_table *stable,
struct static_path *pn;
struct static_route_info *si;
- for (rn = route_top(stable); rn; rn = route_next(rn)) {
+ for (rn = route_top(stable); rn; rn = srcdest_route_next(rn)) {
si = static_route_info_from_rnode(rn);
if (!si)
continue;