summaryrefslogtreecommitdiff
path: root/ospfd/ospf_interface.c
diff options
context:
space:
mode:
authorPaul Jakma <paul.jakma@sun.com>2006-07-26 09:37:26 +0000
committerPaul Jakma <paul.jakma@sun.com>2006-07-26 09:37:26 +0000
commit1fe6ed38cd0136c514aabae01389653beab27fb9 (patch)
tree21f10bc3f9c5afffe9f28e5dbf4e6198cfafba5b /ospfd/ospf_interface.c
parent3fed4160cd23f1767d8980e8cba10bc3933947d5 (diff)
[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_interface.c')
-rw-r--r--ospfd/ospf_interface.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index 2c2c0749..31275f89 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -289,7 +289,7 @@ ospf_if_cleanup (struct ospf_interface *oi)
/* Cleanup Link State Acknowlegdment list. */
for (ALL_LIST_ELEMENTS (oi->ls_ack, node, nnode, lsa))
- ospf_lsa_unlock (lsa);
+ ospf_lsa_unlock (&lsa); /* oi->ls_ack */
list_delete_all_node (oi->ls_ack);
oi->crypt_seqnum = 0;
@@ -302,7 +302,7 @@ ospf_if_cleanup (struct ospf_interface *oi)
oi->nbr_self = ospf_nbr_new (oi);
ospf_nbr_add_self (oi);
- ospf_lsa_unlock (oi->network_lsa_self);
+ ospf_lsa_unlock (&oi->network_lsa_self);
oi->network_lsa_self = NULL;
OSPF_TIMER_OFF (oi->t_network_lsa_self);
}