From 3a7eb6b80f3f36768ec6a2d9aca916e0afb3529d Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Sun, 7 Oct 2012 15:55:25 +0200 Subject: [PATCH] Fix: Drop ongoing UL TBF, if another UL TBF is established for same TLLI This happens, if the mobile looses coverage and establishes a subsequent uplink TBF. --- src/gprs_rlcmac_data.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/gprs_rlcmac_data.cpp b/src/gprs_rlcmac_data.cpp index dca3f0cf..5e7caf0d 100644 --- a/src/gprs_rlcmac_data.cpp +++ b/src/gprs_rlcmac_data.cpp @@ -847,7 +847,7 @@ int gprs_rlcmac_rcv_data_block_acknowledged(uint8_t trx, uint8_t ts, /* get TLLI */ if (!tbf->tlli_valid) { - struct gprs_rlcmac_tbf *dl_tbf; + struct gprs_rlcmac_tbf *dl_tbf, *ul_tbf; /* no TLLI yet */ if (!rh->ti) { @@ -861,7 +861,6 @@ int gprs_rlcmac_rcv_data_block_acknowledged(uint8_t trx, uint8_t ts, "of UL DATA TBF=%d.\n", rh->tfi); return 0; } - tbf->tlli_valid = 1; LOGP(DRLCMACUL, LOGL_INFO, "Decoded premier TLLI=0x%08x of " "UL DATA TBF=%d.\n", tbf->tlli, rh->tfi); if ((dl_tbf = tbf_by_tlli(tbf->tlli, GPRS_RLCMAC_DL_TBF))) { @@ -871,6 +870,17 @@ int gprs_rlcmac_rcv_data_block_acknowledged(uint8_t trx, uint8_t ts, dl_tbf->tfi); tbf_free(dl_tbf); } + /* tbf_by_tlli will not find your TLLI, because it is not + * yet marked valid */ + if ((ul_tbf = tbf_by_tlli(tbf->tlli, GPRS_RLCMAC_UL_TBF))) { + LOGP(DRLCMACUL, LOGL_NOTICE, "Got RACH from " + "TLLI=0x%08x while UL TBF=%d still exists. " + "Killing pending UL TBF\n", tbf->tlli, + ul_tbf->tfi); + tbf_free(ul_tbf); + } + /* mark TLLI valid now */ + tbf->tlli_valid = 1; /* already have TLLI, but we stille get another one */ } else if (rh->ti) { uint32_t tlli;