From 99a107dbeef03b2e80aff82023cdfc5c10109b5b Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Thu, 27 Sep 2012 09:21:52 +0200 Subject: Free existing UL/DL TBF, if RACH has been received from MS In this case the mobile has lost existing flows, so it make sense to free them. The TFI(s) can be re-used immidiately, because they are not associated by MS anymore. --- src/gprs_rlcmac_data.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/gprs_rlcmac_data.cpp b/src/gprs_rlcmac_data.cpp index b6d50622..dedf98a8 100644 --- a/src/gprs_rlcmac_data.cpp +++ b/src/gprs_rlcmac_data.cpp @@ -380,8 +380,25 @@ int gprs_rlcmac_rcv_control_block(bitvec *rlc_block, uint8_t trx, uint8_t ts, if (ul_control_block->u.Packet_Resource_Request.ID.UnionType) { tlli = ul_control_block->u.Packet_Resource_Request.ID.u.TLLI; tbf = tbf_by_tlli(tlli, GPRS_RLCMAC_UL_TBF); + if (tbf) { + LOGP(DRLCMACUL, LOGL_NOTICE, "Got RACH from " + "TLLI=0x%08x while UL TBF=%d still " + "exists. Killing pending DL TBF\n", + tlli, tbf->tfi); + tbf_free(tbf); + tbf = NULL; + } if (!tbf) { uint8_t ms_class = 0; + struct gprs_rlcmac_tbf *dl_tbf; + + if ((dl_tbf = tbf_by_tlli(tlli, GPRS_RLCMAC_DL_TBF))) { + LOGP(DRLCMACUL, LOGL_NOTICE, "Got RACH from " + "TLLI=0x%08x while DL TBF=%d still exists. " + "Killing pending DL TBF\n", tlli, + dl_tbf->tfi); + tbf_free(dl_tbf); + } LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF " "in packet ressource request of single " "block, so we provide one:\n"); -- cgit v1.2.3