summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_te.c
diff options
context:
space:
mode:
authorpaul <paul>2006-07-26 09:37:26 +0000
committerpaul <paul>2006-07-26 09:37:26 +0000
commit4300b2b4530e8b5cd43837ca2daa517af40cf9c2 (patch)
treee9607d709425729267f8b1a3e90b561a635e683b /ospfd/ospf_te.c
parentb8009dd76c7d2169edbd72e792f472b0001b0e67 (diff)
downloadquagga-4300b2b4530e8b5cd43837ca2daa517af40cf9c2.tar.bz2
quagga-4300b2b4530e8b5cd43837ca2daa517af40cf9c2.tar.xz
[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_te.c')
-rw-r--r--ospfd/ospf_te.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c
index 10a94b8d..a3ebe62e 100644
--- a/ospfd/ospf_te.c
+++ b/ospfd/ospf_te.c
@@ -904,7 +904,7 @@ ospf_mpls_te_lsa_new (struct ospf_area *area, struct mpls_te_link *lp)
if ((new->data = ospf_lsa_data_new (length)) == NULL)
{
zlog_warn ("ospf_mpls_te_lsa_new: ospf_lsa_data_new() ?");
- ospf_lsa_unlock (new);
+ ospf_lsa_unlock (&new);
new = NULL;
stream_free (s);
goto out;
@@ -936,7 +936,7 @@ ospf_mpls_te_lsa_originate1 (struct ospf_area *area, struct mpls_te_link *lp)
if (ospf_lsa_install (area->ospf, NULL/*oi*/, new) == NULL)
{
zlog_warn ("ospf_mpls_te_lsa_originate1: ospf_lsa_install() ?");
- ospf_lsa_unlock (new);
+ ospf_lsa_unlock (&new);
goto out;
}
@@ -1054,7 +1054,7 @@ ospf_mpls_te_lsa_refresh (struct ospf_lsa *lsa)
if (ospf_lsa_install (area->ospf, NULL/*oi*/, new) == NULL)
{
zlog_warn ("ospf_mpls_te_lsa_refresh: ospf_lsa_install() ?");
- ospf_lsa_unlock (new);
+ ospf_lsa_unlock (&new);
goto out;
}