summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_session.c
diff options
context:
space:
mode:
authorChris Hall <chris.hall@highwayman.com>2011-08-12 15:06:06 +0100
committerChris Hall <chris.hall@highwayman.com>2011-08-12 15:06:06 +0100
commitcec1fae79110dffa900c0c5f38c3d3b48f5b0db6 (patch)
tree408055322e19098b98766168624f1b96865ac73b /bgpd/bgp_session.c
parent228e06bad624a33090da4a09f32f8fed84a7e15c (diff)
parent7bd8653ef788a6395b07583d6766be8950598342 (diff)
downloadquagga-ex18p.tar.bz2
quagga-ex18p.tar.xz
Merge branch 'euro_ix' of /git/quagga.euro-ix into pipeworkex18p
Merge with euro_ix branch v0.99.18ex17. Update version to: 0.99.18ex18p Of particular note: * includes support for GTSM: neighbor ... ttl-security hops X no neighbor ... ttl-security hops X where X is 1-254. For usual case of immediately connected peer, X == 1. Cannot set ttl-security while ebgp-multihop is set, and vice-versa. If underlying O/S does not support GTSM, then will set ttl as per ebgp-multihop. In passing, have fixed various bugs in the main Quagga branch. * initial support for draft-ietf-idr-optional-transitive Does not yet support "neighbor-complete" flag. * main Quagga now uses TCP_CORK and permanent non-blocking Do not beleive TCP_CORK to be necessary for euro_ix code... which has a different buffering strategy. The euro_ix code already runs sockets permanently non-blocking. * various fixes to attribute intern/unintern Trying to remove memory leaks. Nobody seems convinced that this has been perfected, yet. * fixes for ospfd and ospf6d issues. Up to date with master branch up to: commit 538cb284864c17de66152a5236db4cd80e3e7639 Merge: 036a6e6 8ced4e8 Author: Paul Jakma <paul@quagga.net> Date: Fri Jul 29 18:21:50 2011 +0100
Diffstat (limited to 'bgpd/bgp_session.c')
-rw-r--r--bgpd/bgp_session.c39
1 files changed, 23 insertions, 16 deletions
diff --git a/bgpd/bgp_session.c b/bgpd/bgp_session.c
index d09fe217..7e04e216 100644
--- a/bgpd/bgp_session.c
+++ b/bgpd/bgp_session.c
@@ -324,11 +324,12 @@ bgp_session_enable(bgp_peer peer)
session->open_send = bgp_peer_open_state_init_new(session->open_send, peer) ;
bgp_open_state_unset(&session->open_recv) ;
- session->connect = (peer->flags & PEER_FLAG_PASSIVE) == 0 ;
- session->listen = 1 ;
+ session->connect = (peer->flags & PEER_FLAG_PASSIVE) == 0 ;
+ session->listen = true ;
- session->ttl = peer->ttl ;
- session->port = peer->port ;
+ session->ttl = peer->ttl ;
+ session->gtsm = peer->gtsm ;
+ session->port = peer->port ;
if (session->ifname != NULL)
free(session->ifname) ;
@@ -952,23 +953,26 @@ bgp_session_do_XON(mqueue_block mqb, mqb_flag_t flag)
}
/*==============================================================================
- * Routing Engine: send set ttl message to BGP Engine
- *
- */
+ * Routing Engine: send set ttl message to BGP Engine, if session is active.
+ */
void
-bgp_session_set_ttl(bgp_session session, int ttl)
+bgp_session_set_ttl(bgp_session session, int ttl, bool gtsm)
{
mqueue_block mqb ;
struct bgp_session_ttl_args *args;
- mqb = mqb_init_new(NULL, bgp_session_do_set_ttl, session) ;
+ if (bgp_session_is_active(session))
+ {
+ mqb = mqb_init_new(NULL, bgp_session_do_set_ttl, session) ;
- args = mqb_get_args(mqb) ;
- args->ttl = ttl ;
+ args = mqb_get_args(mqb) ;
+ args->ttl = ttl ;
+ args->gtsm = gtsm ;
- ++bgp_engine_queue_stats.event ;
+ ++bgp_engine_queue_stats.event ;
- bgp_to_bgp_engine(mqb, mqb_ordinary) ;
+ bgp_to_bgp_engine(mqb, mqb_ordinary) ;
+ } ;
}
/*------------------------------------------------------------------------------
@@ -985,10 +989,13 @@ bgp_session_do_set_ttl(mqueue_block mqb, mqb_flag_t flag)
BGP_SESSION_LOCK(session) ; /*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
- session->ttl = args->ttl ;
+ session->ttl = args->ttl ;
+ session->gtsm = args->gtsm ;
- bgp_set_ttl(session->connections[bgp_connection_primary], session->ttl);
- bgp_set_ttl(session->connections[bgp_connection_secondary], session->ttl);
+ bgp_set_new_ttl(session->connections[bgp_connection_primary],
+ session->ttl, session->gtsm) ;
+ bgp_set_new_ttl(session->connections[bgp_connection_secondary],
+ session->ttl, session->gtsm) ;
BGP_SESSION_UNLOCK(session) ; /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
}