summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_session.c
diff options
context:
space:
mode:
authorChris Hall <GMCH@hestia.halldom.com>2010-02-01 15:24:53 +0000
committerChris Hall <GMCH@hestia.halldom.com>2010-02-01 15:24:53 +0000
commitd5f02454cbd702fe23c8977d49e1c5420b02e362 (patch)
tree1a28c41774be5e142937d08ebcd347ae1fc4e614 /bgpd/bgp_session.c
parente51f1f9733ddc294bffb50fc29f25dcdebf44d6d (diff)
downloadquagga-d5f02454cbd702fe23c8977d49e1c5420b02e362.tar.bz2
quagga-d5f02454cbd702fe23c8977d49e1c5420b02e362.tar.xz
Clearing up the reaping of connections, and handling of notifications.
modified: bgpd/bgp_connection.c modified: bgpd/bgp_fsm.c modified: bgpd/bgp_fsm.h modified: bgpd/bgp_msg_read.c modified: bgpd/bgp_peer.c modified: bgpd/bgp_session.c
Diffstat (limited to 'bgpd/bgp_session.c')
-rw-r--r--bgpd/bgp_session.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/bgpd/bgp_session.c b/bgpd/bgp_session.c
index e0c3972e..3c89b3f4 100644
--- a/bgpd/bgp_session.c
+++ b/bgpd/bgp_session.c
@@ -192,7 +192,7 @@ bgp_session_free(bgp_session session)
qpt_mutex_destroy(&session->mutex, 0) ;
- bgp_notify_free(session->notification);
+ bgp_notify_unset(&session->notification);
bgp_open_state_free(session->open_send);
bgp_open_state_free(session->open_recv);
if (session->ifname != NULL)
@@ -359,6 +359,9 @@ bgp_session_do_enable(mqueue_block mqb, mqb_flag_t flag)
* The BGP Engine will stop the session -- unless it is already stopped due to
* some event in the BGP Engine. In any case, the BGP Engine will respond with
* an eDisabled.
+ *
+ * NB: is taking responsibility for the notification, which is either freed
+ * here or passed to the BGP Engine.
*/
extern void
bgp_session_disable(bgp_peer peer, bgp_notify notification)
@@ -420,21 +423,25 @@ bgp_session_disable(bgp_peer peer, bgp_notify notification)
/*------------------------------------------------------------------------------
* BGP Engine: session disable message action
+ *
+ * NB: either passes the notification to the FSM or frees it here.
*/
static void
bgp_session_do_disable(mqueue_block mqb, mqb_flag_t flag)
{
+ bgp_session session = mqb_get_arg0(mqb) ;
+ struct bgp_session_disable_args* args = mqb_get_args(mqb) ;
+
if (flag == mqb_action)
{
- bgp_session session = mqb_get_arg0(mqb) ;
- struct bgp_session_disable_args* args = mqb_get_args(mqb) ;
-
/* Immediately discard any other messages for this session. */
mqueue_revoke(bgp_nexus->queue, session) ;
/* Get the FSM to send any notification and close connections */
bgp_fsm_disable_session(session, args->notification) ;
- } ;
+ }
+ else
+ bgp_notify_free(args->notification) ;
mqb_free(mqb) ;
}
@@ -442,7 +449,7 @@ bgp_session_do_disable(mqueue_block mqb, mqb_flag_t flag)
/*==============================================================================
* BGP Engine: send session event signal to Routeing Engine
*
- * NB: is taking responsibility for the notification.
+ * NB: is passing responsibility for the notification to the Peering Engine.
*/
extern void
bgp_session_event(bgp_session session, bgp_session_event_t event,