]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: fd leak in bgpd
authorSteve Hill <quagga@cheesy.sackheads.org>
Tue, 28 Jul 2009 16:50:00 +0000 (17:50 +0100)
committerPaul Jakma <paul@quagga.net>
Tue, 28 Jul 2009 16:50:00 +0000 (17:50 +0100)
commit3117b5c47df044f8b2197fff60641075394fdce5
tree0a25f9376ab96e21d9e161f9c9e156fbd5641d53
parentcb9e0ceec988a059dd2269ebc54722c01afb7cca
bgpd: fd leak in bgpd

* bgp_fsm.c: I have found an fd leak in bgpd that is caused by the 'new'
  Clearing state.  I've been seeing it from hold timer failures, but it can
  also be triggered by other things.

  When Hold_Timer_expired fires in Established state, a notify is sent and
  BGP_Stop event queued.  The fsm then transitions into Clearing state.
  That is the problem; When the BGP_Stop event is serviced, the state table
  says to ignore it while in Clearing.  Thus bgp_stop is not called and the
  fd leaks.  Previously the peer would be in Idle state, which correctly
  handles the BGP_Stop event.

  Fix by making bgp_stop safe to call from Clearing state, without losing
  ClearingCompleted events, and then ensuring it is called prior to
  transition from Clearing->Idle.
bgpd/bgp_fsm.c