summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_peer.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_peer.c')
-rw-r--r--bgpd/bgp_peer.c53
1 files changed, 29 insertions, 24 deletions
diff --git a/bgpd/bgp_peer.c b/bgpd/bgp_peer.c
index f9abb3c1..7607014e 100644
--- a/bgpd/bgp_peer.c
+++ b/bgpd/bgp_peer.c
@@ -21,24 +21,15 @@
* Boston, MA 02111-1307, USA.
*/
-#include <zebra.h>
+#include "bgpd/bgp_peer.h"
-#include "linklist.h"
-#include "prefix.h"
-#include "vty.h"
-#include "sockunion.h"
-#include "thread.h"
-#include "log.h"
-#include "stream.h"
-#include "memory.h"
-#include "plist.h"
-#include "mqueue.h"
-#include "workqueue.h"
+#include <zebra.h>
-#include "bgpd/bgpd.h"
-#include "bgpd/bgp_peer.h"
+#include "bgpd/bgp_common.h"
+#include "bgpd/bgp_session.h"
+#include "bgpd/bgp_engine.h"
#include "bgpd/bgp_peer_index.h"
-
+#include "bgpd/bgpd.h"
#include "bgpd/bgp_attr.h"
#include "bgpd/bgp_debug.h"
#include "bgpd/bgp_fsm.h"
@@ -49,8 +40,17 @@
#include "bgpd/bgp_open.h"
#include "bgpd/bgp_advertise.h"
-#include "bgpd/bgp_engine.h"
-#include "bgpd/bgp_session.h"
+#include "linklist.h"
+#include "prefix.h"
+#include "vty.h"
+#include "sockunion.h"
+#include "thread.h"
+#include "log.h"
+#include "stream.h"
+#include "memory.h"
+#include "plist.h"
+#include "mqueue.h"
+#include "workqueue.h"
#ifdef HAVE_SNMP
#include "bgpd/bgp_snmp.h"
@@ -298,7 +298,8 @@ bgp_session_has_disabled(bgp_peer peer)
session->state = bgp_session_sDisabled ;
- /* TODO: here should revoke session in Peering Engine message queue */
+ /* Immediately discard any other messages for this session. */
+ mqueue_revoke(routing_nexus->queue, session) ;
/* does the session need to be re-enabled? */
if (session->defer_enable)
@@ -741,12 +742,12 @@ peer_create (union sockunion *su, struct bgp *bgp, as_t local_as,
if (! active && peer_active (peer))
bgp_timer_set (peer);
- /* session */
- peer->session = bgp_session_init_new(peer->session, peer);
-
/* register */
bgp_peer_index_register(peer, &peer->su);
+ /* session */
+ peer->session = bgp_session_init_new(peer->session, peer);
+
return peer;
}
@@ -796,7 +797,8 @@ peer_delete (struct peer *peer)
*/
peer->last_reset = PEER_DOWN_NEIGHBOR_DELETE;
bgp_peer_stop (peer);
- bgp_fsm_change_status (peer, Deleted);
+ /* TODO: Deleted status */
+ /* bgp_fsm_change_status (peer, Deleted); */
/* Password configuration */
if (peer->password)
@@ -969,8 +971,11 @@ peer_nsf_stop (struct peer *peer)
void
bgp_peer_reenable(bgp_peer peer, bgp_notify notification)
{
- bgp_peer_disable(peer, notification);
- bgp_peer_enable(peer); /* may defer if still stopping */
+ if (bgp_session_is_active(peer->session))
+ {
+ bgp_peer_disable(peer, notification);
+ bgp_peer_enable(peer); /* may defer if still stopping */
+ }
}
/* enable the peer */