aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-02-26 14:59:52 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-02-26 16:22:34 +0100
commit297edf754f74066d3885d429a67c2f989ced9bf0 (patch)
tree104e96ec437840af9f7f61c3898f9d86b30f88e5
parent08fe76a89334ddc4ee906bd30a00d908745b2b7b (diff)
tbf: Don't use 'old' DL TBFs after reuse_tbf
Currently two DL TBF objects with the same TLLI exist after reuse_tbf which make the result of tbf_by_tlli undefined. This leads to several DL TBFs belonging to the same TLLI. This commit extends tbf_by_tlli to check the m_tlli_valid flag for DL, too. That flag is set to 0 in reuse_tbf to mark the 'old' DL TBF as invalid after its LLC data has been copied to the new one. Sponsored-by: On-Waves ehf
-rw-r--r--src/bts.cpp2
-rw-r--r--src/tbf_dl.cpp3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/bts.cpp b/src/bts.cpp
index b6600144..6100248e 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -243,7 +243,7 @@ gprs_rlcmac_tbf *BTS::tbf_by_tlli(uint32_t tlli, enum gprs_rlcmac_tbf_direction
} else {
llist_pods_for_each_entry(tbf, &m_bts.dl_tbfs, list, lpods) {
if (tbf->state_is_not(GPRS_RLCMAC_RELEASING)
- && tbf->tlli() == tlli)
+ && tbf->tlli() == tlli && tbf->is_tlli_valid())
return tbf;
}
}
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 8de3b2b6..89ca9c2a 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -689,6 +689,9 @@ void gprs_rlcmac_dl_tbf::reuse_tbf(const uint8_t *data, const uint16_t len)
m_wait_confirm = 0;
m_window.reset();
+ /* mark TLLI as invalid */
+ m_tlli_valid = 0;
+
/* keep to flags */
state_flags &= GPRS_RLCMAC_FLAG_TO_MASK;
state_flags &= ~(1 << GPRS_RLCMAC_FLAG_CCCH);