diff options
author | paul <paul> | 2005-11-11 12:10:03 +0000 |
---|---|---|
committer | paul <paul> | 2005-11-11 12:10:03 +0000 |
commit | fd036ca7dbead2c524805913f0ba2ae860e45939 (patch) | |
tree | 000557928d3683bdd15110f1ba1dabee91138c0f /ospfd/ospf_spf.c | |
parent | 74acd2d43e6faa14533b8dc7e2721395c05ad283 (diff) | |
download | quagga-fd036ca7dbead2c524805913f0ba2ae860e45939.tar.bz2 quagga-fd036ca7dbead2c524805913f0ba2ae860e45939.tar.xz |
[ospfd] SPF ospf_canonical_nexthops_free bugfix.quagga.0.99.2.release
Diffstat (limited to 'ospfd/ospf_spf.c')
-rw-r--r-- | ospfd/ospf_spf.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c index 564ae847..dbd06361 100644 --- a/ospfd/ospf_spf.c +++ b/ospfd/ospf_spf.c @@ -94,11 +94,20 @@ ospf_canonical_nexthops_free (struct vertex *root) struct listnode *n2, *nn2; struct vertex_parent *vp; + /* router vertices through an attached network each + * have a distinct (canonical / not inherited) nexthop + * which must be freed. + * + * A network vertex can only have router vertices as its + * children, so only one level of recursion is possible. + */ if (child->type == OSPF_VERTEX_NETWORK) ospf_canonical_nexthops_free (child); + /* Free child nexthops pointing back to this root vertex */ for (ALL_LIST_ELEMENTS (child->parents, n2, nn2, vp)) - vertex_nexthop_free (vp->nexthop); + if (vp->parent == root) + vertex_nexthop_free (vp->nexthop); } } |