diff options
author | hasso <hasso> | 2004-08-19 08:56:53 +0200 |
---|---|---|
committer | hasso <hasso> | 2004-08-19 08:56:53 +0200 |
commit | 3b68735fc38871bdcc9fc19f38fab244f86e710b (patch) | |
tree | 3a98be6997b0fc0e0bd211a877ab477cb7e3d328 /ospf6d/ospf6d.c | |
parent | 2004-08-19 Paul Jakma <paul@dishone.st> (diff) | |
download | frr-3b68735fc38871bdcc9fc19f38fab244f86e710b.tar.xz frr-3b68735fc38871bdcc9fc19f38fab244f86e710b.zip |
Merge svn revisions 924 and 925 from Zebra CVS. Also remove useless
ospf6_lsdb prototype declaration from ospf6_lsa.h. Report sent to Yasuhiro
Ohara as well.
Diffstat (limited to 'ospf6d/ospf6d.c')
-rw-r--r-- | ospf6d/ospf6d.c | 83 |
1 files changed, 10 insertions, 73 deletions
diff --git a/ospf6d/ospf6d.c b/ospf6d/ospf6d.c index 6cc0764a3..28e6b9455 100644 --- a/ospf6d/ospf6d.c +++ b/ospf6d/ospf6d.c @@ -50,92 +50,29 @@ ospf6_debug () { } -static struct route_node * -_route_next_until (struct route_node *node, struct route_node *limit) -{ - struct route_node *next; - struct route_node *start; - - /* Node may be deleted from route_unlock_node so we have to preserve - next node's pointer. */ - - if (node->l_left) - { - next = node->l_left; - if (next == limit) - { - route_unlock_node (node); - return NULL; - } - route_lock_node (next); - route_unlock_node (node); - return next; - } - if (node->l_right) - { - next = node->l_right; - if (next == limit) - { - route_unlock_node (node); - return NULL; - } - route_lock_node (next); - route_unlock_node (node); - return next; - } - - start = node; - while (node->parent) - { - if (node->parent->l_left == node && node->parent->l_right) - { - next = node->parent->l_right; - if (next == limit) - { - route_unlock_node (start); - return NULL; - } - route_lock_node (next); - route_unlock_node (start); - return next; - } - node = node->parent; - } - - route_unlock_node (start); - return NULL; -} - struct route_node * route_prev (struct route_node *node) { struct route_node *end; struct route_node *prev = NULL; - if (node->parent == NULL) - { - route_unlock_node (node); - return NULL; - } - - if (node->parent->l_left == node) - { - prev = node->parent; - route_lock_node (prev); - route_unlock_node (node); - return prev; - } - end = node; node = node->parent; - route_lock_node (node); + if (node) + route_lock_node (node); while (node) { prev = node; - node = _route_next_until (node, end); + node = route_next (node); + if (node == end) + { + route_unlock_node (node); + node = NULL; + } } route_unlock_node (end); - route_lock_node (prev); + if (prev) + route_lock_node (prev); return prev; } |