From 7d5157ee17f60ab1455bc61e514803916201c444 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Mon, 1 Feb 2016 18:15:35 +0100 Subject: [PATCH] tbf: Only free TBF if it was replaced in rcv_control_ack Currently the TBF whose PACCH has been used to send an assigment is freed if it is in state WAIT_RELEASE. Sometimes this TBF could be used for several assignments (e.g. an 'old' DL TBF is used to assign an UL and then a DL TBF). The second of these assigments will never be sent in that case. On the other hand, the MS replaces a TBF of the same direction, so the old one can be freed in that case. Only free the TBF if it is in state WAIT_RELEASE and has the same direction like the new one. Sponsored-by: On-Waves ehf --- src/bts.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bts.cpp b/src/bts.cpp index 8337b068..5cadda1b 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -799,7 +799,8 @@ void gprs_rlcmac_pdch::rcv_control_ack(Packet_Control_Acknowledgement_t *packet, "TBF is gone TLLI=0x%08x\n", tlli); return; } - if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE)) + if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE) && + tbf->direction == new_tbf->direction) tbf_free(tbf); if ((new_tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) { @@ -836,7 +837,8 @@ void gprs_rlcmac_pdch::rcv_control_ack(Packet_Control_Acknowledgement_t *packet, "TBF is gone TLLI=0x%08x\n", tlli); return; } - if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE)) + if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE) && + tbf->direction == new_tbf->direction) tbf_free(tbf); new_tbf->set_state(GPRS_RLCMAC_FLOW);