summaryrefslogtreecommitdiff
path: root/bgpd/bgp_fsm.c
diff options
context:
space:
mode:
authorPaul Jakma <paul.jakma@sun.com>2006-09-14 03:02:02 +0000
committerPaul Jakma <paul.jakma@sun.com>2006-09-14 03:02:02 +0000
commit9fde6624fc480995449d8243fe85602d89927eb6 (patch)
tree6591e476329ec88bd9ba5fcc008c626d32b3fdb5 /bgpd/bgp_fsm.c
parentca058a30b1ea57f83871ab4cf1c9a91ea4064d52 (diff)
[bgpd] simplify peer refcounts, squash slow peer leak
2006-09-14 Paul Jakma <paul.jakma@sun.com> * (general) fix the peer refcount issue exposed by previous, by just removing refcounting of peer threads, which is mostly senseless as they're references leading from struct peer, which peer_free cancels anyway. No need to muck around.. * bgp_fsm.h: Just remove the refcounting from the various TIMER/READ/WRITE/EVENT ON/OFF/ADD macros. * bgp_fsm.c: (bgp_stop) use BGP_EVENT_FLUSH, no refcounts attached to events anymore. (bgp_event) remove peer_unlock, events not refcounted. * bgpd.c: (peer_free) flush events before free.
Diffstat (limited to 'bgpd/bgp_fsm.c')
-rw-r--r--bgpd/bgp_fsm.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index bdb6517f..cc2b2c3a 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -426,7 +426,6 @@ bgp_stop (struct peer *peer)
{
afi_t afi;
safi_t safi;
- unsigned int i;
char orf_name[BUFSIZ];
/* Increment Dropped count. */
@@ -500,10 +499,8 @@ bgp_stop (struct peer *peer)
BGP_TIMER_OFF (peer->t_asorig);
BGP_TIMER_OFF (peer->t_routeadv);
- /* Delete all existing events of the peer,
- and corresponding peer ref-count */
- for (i = thread_cancel_event (master, peer); i > 0; i--)
- peer_unlock (peer); /* thread event reference */
+ /* Delete all existing events of the peer */
+ BGP_EVENT_FLUSH (peer);
/* Stream reset. */
peer->packet_size = 0;
@@ -1101,6 +1098,5 @@ bgp_event (struct thread *thread)
bgp_timer_set (peer);
}
- peer_unlock (peer); /* bgp-event peer reference */
return ret;
}