diff options
author | Paul Jakma <paul.jakma@sun.com> | 2006-07-26 11:37:26 +0200 |
---|---|---|
committer | Paul Jakma <paul.jakma@sun.com> | 2006-07-26 11:37:26 +0200 |
commit | 1fe6ed38cd0136c514aabae01389653beab27fb9 (patch) | |
tree | 21f10bc3f9c5afffe9f28e5dbf4e6198cfafba5b /ospfd/ospf_lsdb.c | |
parent | [ospfd] Additional NSM neighbour state change stats/information (diff) | |
download | frr-1fe6ed38cd0136c514aabae01389653beab27fb9.tar.xz frr-1fe6ed38cd0136c514aabae01389653beab27fb9.zip |
[ospfd] Allow ospf_lsa_unlock to NULL out callers' LSA pointers upon free
2006-07-26 Paul Jakma <paul.jakma@sun.com>
* ospf_lsa.{c,h}: (ospf_lsa_unlock) Change to take a double pointer
to the LSA to be 'unlocked', so that, if the LSA is freed, the
callers pointer to the LSA can be NULLed out, allowing any further
use of that pointer to provoke a crash sooner rather than later.
* ospf_*.c: (general) Adjust callers of ospf_lsa_unlock to match
previous. Try annotate 'locking' somewhat to show which 'locks'
are protecting what LSA reference, if not obvious.
* ospf_opaque.c: (ospf_opaque_lsa_install) Trivial: remove useless
goto, replace with return.
* ospf_packet.c: (ospf_make_ls_ack) Trivial: merge two list loops,
the dual-loop predated the delete-safe list-loop macro.
Diffstat (limited to 'ospfd/ospf_lsdb.c')
-rw-r--r-- | ospfd/ospf_lsdb.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ospfd/ospf_lsdb.c b/ospfd/ospf_lsdb.c index b161b8067..28d92bde2 100644 --- a/ospfd/ospf_lsdb.c +++ b/ospfd/ospf_lsdb.c @@ -108,7 +108,7 @@ ospf_lsdb_add (struct ospf_lsdb *lsdb, struct ospf_lsa *lsa) old = rn->info; lsdb->type[old->data->type].checksum -= ntohs(old->data->checksum); - ospf_lsa_unlock (rn->info); + ospf_lsa_unlock (&rn->info); route_unlock_node (rn); } @@ -161,7 +161,7 @@ ospf_lsdb_delete (struct ospf_lsdb *lsdb, struct ospf_lsa *lsa) if (lsdb->del_lsa_hook != NULL) (* lsdb->del_lsa_hook)(lsa); #endif /* MONITOR_LSDB_CHANGE */ - ospf_lsa_unlock (lsa); + ospf_lsa_unlock (&lsa); return; } } @@ -191,7 +191,7 @@ ospf_lsdb_delete_all (struct ospf_lsdb *lsdb) if (lsdb->del_lsa_hook != NULL) (* lsdb->del_lsa_hook)(lsa); #endif /* MONITOR_LSDB_CHANGE */ - ospf_lsa_unlock (lsa); + ospf_lsa_unlock (&lsa); } } } |