diff options
author | Paul Jakma <paul.jakma@sun.com> | 2006-07-26 09:37:26 +0000 |
---|---|---|
committer | Paul Jakma <paul.jakma@sun.com> | 2006-07-26 09:37:26 +0000 |
commit | 1fe6ed38cd0136c514aabae01389653beab27fb9 (patch) | |
tree | 21f10bc3f9c5afffe9f28e5dbf4e6198cfafba5b /ospfd/ospf_flood.c | |
parent | 3fed4160cd23f1767d8980e8cba10bc3933947d5 (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_flood.c')
-rw-r--r-- | ospfd/ospf_flood.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ospfd/ospf_flood.c b/ospfd/ospf_flood.c index d7ab859e..91cbbf3d 100644 --- a/ospfd/ospf_flood.c +++ b/ospfd/ospf_flood.c @@ -72,7 +72,7 @@ ospf_flood_delayed_lsa_ack (struct ospf_neighbor *inbr, struct ospf_lsa *lsa) return; /* Schedule a delayed LSA Ack to be sent */ - listnode_add (inbr->oi->ls_ack, ospf_lsa_lock (lsa)); + listnode_add (inbr->oi->ls_ack, ospf_lsa_lock (lsa)); /* delayed LSA Ack */ } /* Check LSA is related to external info. */ @@ -134,7 +134,7 @@ ospf_process_self_originated_lsa (struct ospf *ospf, case OSPF_ROUTER_LSA: /* Originate a new instance and schedule flooding */ /* It shouldn't be necessary, but anyway */ - ospf_lsa_unlock (area->router_lsa_self); + ospf_lsa_unlock (&area->router_lsa_self); area->router_lsa_self = ospf_lsa_lock (new); ospf_router_lsa_timer_add (area); @@ -170,7 +170,7 @@ ospf_process_self_originated_lsa (struct ospf *ospf, } #endif /* HAVE_OPAQUE_LSA */ - ospf_lsa_unlock (oi->network_lsa_self); + ospf_lsa_unlock (&oi->network_lsa_self); oi->network_lsa_self = ospf_lsa_lock (new); /* Schedule network-LSA origination. */ @@ -797,7 +797,7 @@ ospf_ls_request_delete (struct ospf_neighbor *nbr, struct ospf_lsa *lsa) { if (nbr->ls_req_last == lsa) { - ospf_lsa_unlock (nbr->ls_req_last); + ospf_lsa_unlock (&nbr->ls_req_last); nbr->ls_req_last = NULL; } @@ -813,7 +813,7 @@ ospf_ls_request_delete (struct ospf_neighbor *nbr, struct ospf_lsa *lsa) void ospf_ls_request_delete_all (struct ospf_neighbor *nbr) { - ospf_lsa_unlock (nbr->ls_req_last); + ospf_lsa_unlock (&nbr->ls_req_last); nbr->ls_req_last = NULL; ospf_lsdb_delete_all (&nbr->ls_req); } @@ -922,7 +922,7 @@ ospf_ls_retransmit_clear (struct ospf_neighbor *nbr) ospf_ls_retransmit_delete (nbr, lsa); } - ospf_lsa_unlock (nbr->ls_req_last); + ospf_lsa_unlock (&nbr->ls_req_last); nbr->ls_req_last = NULL; } |