From 64b08a2d2ec89e5464d7489f239a5b23a7a0c17b Mon Sep 17 00:00:00 2001 From: Chris Hall Date: Sun, 31 Jan 2010 18:41:22 +0000 Subject: Testing and fixing round. modified: bgpd/bgp_msg_read.c -- fix to accept updates when sEstablished ! modified: bgpd/bgp_packet.c -- modified XON/XOFF handling modified: bgpd/bgp_peer.c -- fix event handling to discard events when sLimping. modified: bgpd/bgp_route.c -- announce routes when sEstablished modified: bgpd/bgp_session.c -- add XOFF test free stream in update_receive when mqb_destroy modified: bgpd/bgp_session.h -- add XOFF threshold & XOFF test modified: bgpd/bgpd.c -- PRO TEM reenable in bgp_clear for max-prefix handling modified: lib/log.c -- fix zlog_backtrace modified: lib/mqueue.c -- dasserts for mqb_free_count --- lib/mqueue.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lib/mqueue.c') diff --git a/lib/mqueue.c b/lib/mqueue.c index 3031891e..7156e31e 100644 --- a/lib/mqueue.c +++ b/lib/mqueue.c @@ -293,18 +293,22 @@ mqb_init_new(mqueue_block mqb, mqueue_action action, void* arg0) { if (mqb == NULL) { - qpt_mutex_lock(&mqb_mutex) ; + qpt_mutex_lock(&mqb_mutex) ; /*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/ mqb = mqb_free_list ; if (mqb == NULL) - mqb = XMALLOC(MTYPE_MQUEUE_BLOCK, sizeof(struct mqueue_block)) ; + { + dassert(mqb_free_count == 0) ; + mqb = XMALLOC(MTYPE_MQUEUE_BLOCK, sizeof(struct mqueue_block)) ; + } else { + dassert(mqb_free_count >= 0) ; mqb_free_list = mqb->next ; --mqb_free_count ; } ; - qpt_mutex_unlock(&mqb_mutex) ; + qpt_mutex_unlock(&mqb_mutex) ; /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/ } ; memset(mqb, 0, sizeof(struct mqueue_block)) ; @@ -649,7 +653,7 @@ mqueue_revoke(mqueue_queue mq, void* arg0) else prev->next = mqb->next ; - if (mq->tail == mqb) + if (mqb == mq->tail) mq->tail = prev ; if (mqb == mq->tail_priority) -- cgit v1.2.3