diff options
author | Chris Hall <GMCH@hestia.halldom.com> | 2010-01-31 18:41:22 +0000 |
---|---|---|
committer | Chris Hall <GMCH@hestia.halldom.com> | 2010-01-31 18:41:22 +0000 |
commit | 64b08a2d2ec89e5464d7489f239a5b23a7a0c17b (patch) | |
tree | a95f5c4c449735a51dcfb49c880e7a8c023cb9cf /lib/mqueue.c | |
parent | abf662dd4bf9d688826378677f14f4b20d07d107 (diff) | |
download | quagga-64b08a2d2ec89e5464d7489f239a5b23a7a0c17b.tar.bz2 quagga-64b08a2d2ec89e5464d7489f239a5b23a7a0c17b.tar.xz |
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
Diffstat (limited to 'lib/mqueue.c')
-rw-r--r-- | lib/mqueue.c | 12 |
1 files changed, 8 insertions, 4 deletions
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) |