diff options
Diffstat (limited to 'ospf6d/ospf6_route.c')
-rw-r--r-- | ospf6d/ospf6_route.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c index b054c7b4..7a5a3941 100644 --- a/ospf6d/ospf6_route.c +++ b/ospf6d/ospf6_route.c @@ -288,6 +288,7 @@ ospf6_route_add (struct ospf6_route *route, ospf6_route_delete (route); SET_FLAG (old->flag, OSPF6_ROUTE_ADD); ospf6_route_count_assert (table); + return old; } @@ -315,10 +316,11 @@ ospf6_route_add (struct ospf6_route *route, ospf6_route_lock (route); SET_FLAG (route->flag, OSPF6_ROUTE_CHANGE); + ospf6_route_count_assert (table); + if (table->hook_add) (*table->hook_add) (route); - ospf6_route_count_assert (table); return route; } @@ -353,12 +355,12 @@ ospf6_route_add (struct ospf6_route *route, ospf6_route_lock (route); table->count++; + ospf6_route_count_assert (table); SET_FLAG (route->flag, OSPF6_ROUTE_ADD); if (table->hook_add) (*table->hook_add) (route); - ospf6_route_count_assert (table); return route; } @@ -414,12 +416,12 @@ ospf6_route_add (struct ospf6_route *route, } table->count++; + ospf6_route_count_assert (table); SET_FLAG (route->flag, OSPF6_ROUTE_ADD); if (table->hook_add) (*table->hook_add) (route); - ospf6_route_count_assert (table); return route; } @@ -470,13 +472,15 @@ ospf6_route_remove (struct ospf6_route *route, node->info = NULL; /* should unlock route_node here ? */ } + table->count--; + ospf6_route_count_assert (table); + + SET_FLAG (route->flag, OSPF6_ROUTE_WAS_REMOVED); + if (table->hook_remove) (*table->hook_remove) (route); ospf6_route_unlock (route); - table->count--; - - ospf6_route_count_assert (table); } struct ospf6_route * |