From ace3b1bdc1d5fcd9edd3c8556249467afb971029 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Wed, 10 Nov 2021 16:11:17 +0100 Subject: [PATCH] pdch: Drop previous UL TBF from MS who sent PktResReq through SBA If the MS has a pending UL TBF but we just received a PktResReq on an allocated SBA from it (same TLLI, hence same MS), then it means it allocated the SBA through RACH req and hence it was on CCCH. That means it was not active on any PDCH, hence for sure the previous UL TBF can be dropped. Related: OS#5293 Change-Id: I1f20dba56f46ea15cbb9b03bdc5b79d923491a3c --- src/pdch.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pdch.cpp b/src/pdch.cpp index 4d82ab16..c48b078e 100644 --- a/src/pdch.cpp +++ b/src/pdch.cpp @@ -680,6 +680,16 @@ void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request, "MS requests UL TBF throguh SBA\n", fn); ms_set_ta(ms, sba->ta); sba_free(sba); + /* If MS identified by TLLI sent us a PktResReq through SBA, it means it came + * from CCCH, so it's for sure not using previous UL + * TBF; drop it if it still exits on our end: */ + if ((ul_tbf = ms_ul_tbf(ms))) { + /* Get rid of previous finished UL TBF before providing a new one */ + LOGPTBFUL(ul_tbf, LOGL_NOTICE, + "Got PACKET RESOURCE REQ while TBF not finished, killing pending UL TBF\n"); + tbf_free(ul_tbf); + ul_tbf = NULL; + } /* MS seized the PDCH answering on the SBA: */ bts_do_rate_ctr_inc(bts, CTR_IMMEDIATE_ASSIGN_UL_TBF_CONTENTION_RESOLUTION_SUCCESS); break;