diff options
-rw-r--r-- | src/gprs_ms.cpp | 14 | ||||
-rw-r--r-- | src/gprs_ms.h | 2 | ||||
-rw-r--r-- | src/tbf.cpp | 10 | ||||
-rw-r--r-- | src/tbf_dl.cpp | 2 | ||||
-rw-r--r-- | tests/tbf/TbfTest.err | 5 |
5 files changed, 20 insertions, 13 deletions
diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp index b0481f31..a5a6cfda 100644 --- a/src/gprs_ms.cpp +++ b/src/gprs_ms.cpp @@ -311,6 +311,20 @@ void GprsMs::reset() m_imsi[0] = '\0'; } +void GprsMs::merge_old_ms(GprsMs *old_ms) +{ + if (old_ms == this) + return; + + if (strlen(imsi()) == 0 && strlen(old_ms->imsi()) != 0) + set_imsi(old_ms->imsi()); + + if (!ms_class() && old_ms->ms_class()) + set_ms_class(old_ms->ms_class()); + + old_ms->reset(); +} + void GprsMs::set_tlli(uint32_t tlli) { if (tlli == m_tlli || tlli == m_new_ul_tlli) diff --git a/src/gprs_ms.h b/src/gprs_ms.h index 7f85578c..c490e7ab 100644 --- a/src/gprs_ms.h +++ b/src/gprs_ms.h @@ -63,6 +63,8 @@ public: void set_callback(Callback *cb) {m_cb = cb;} + void merge_old_ms(GprsMs *old_ms); + gprs_rlcmac_ul_tbf *ul_tbf() const {return m_ul_tbf;} gprs_rlcmac_dl_tbf *dl_tbf() const {return m_dl_tbf;} gprs_rlcmac_tbf *tbf(enum gprs_rlcmac_tbf_direction dir) const; diff --git a/src/tbf.cpp b/src/tbf.cpp index 9f873dc3..c63d7cc2 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -164,14 +164,6 @@ void gprs_rlcmac_tbf::merge_and_clear_ms(GprsMs *old_ms) GprsMs::Guard guard_old(old_ms); - if (strlen(ms()->imsi()) == 0 && strlen(old_ms->imsi()) != 0) { - ms()->set_imsi(old_ms->imsi()); - old_ms->set_imsi(""); - } - - if (!ms()->ms_class() && old_ms->ms_class()) - ms()->set_ms_class(old_ms->ms_class()); - /* Clean up the old MS object */ /* TODO: Use timer? */ if (old_ms->ul_tbf() && old_ms->ul_tbf()->T == 0) { @@ -197,7 +189,7 @@ void gprs_rlcmac_tbf::merge_and_clear_ms(GprsMs *old_ms) } } - old_ms->reset(); + ms()->merge_old_ms(old_ms); } void gprs_rlcmac_tbf::update_ms(uint32_t tlli, enum gprs_rlcmac_tbf_direction dir) diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 1bc08b77..a0510f66 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -230,7 +230,7 @@ int gprs_rlcmac_dl_tbf::handle(struct gprs_rlcmac_bts *bts, if (ms_old->dl_tbf() && ms_old->dl_tbf()->T == 0) tbf_free(ms_old->dl_tbf()); - ms_old->reset(); + ms->merge_old_ms(ms_old); } } diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 35245222..57fd22dc 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -462,14 +462,13 @@ The MS object cannot fully confirm an unexpected TLLI: 0xf1000002, partly confir Modifying MS object, TLLI = 0xf1000001, IMSI '' -> '001001000000001' Modifying MS object, TLLI = 0xf1000001, IMSI '001001000000001' -> '001001000000002' TBF(TFI=1 TLLI=0xf1000002 DIR=DL STATE=FLOW) the IMSI '001001000000002' was already assigned to another MS object: TLLI = 0xf1000001, that IMSI will be removed -Modifying MS object, TLLI = 0xf1000002, IMSI '' -> '001001000000002' -Modifying MS object, TLLI = 0xf1000001, IMSI '001001000000002' -> '' TBF(TFI=0 TLLI=0xf1000001 DIR=DL STATE=FLOW) free TBF(TFI=0 TLLI=0xf1000001 DIR=DL STATE=FLOW) Software error: Pending downlink assignment. This may not happen, because the assignment message never gets transmitted. Please be sure not to free in this state. PLEASE FIX! PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xf1000001 DIR=DL STATE=FLOW), 1 TBFs, USFs = 00, TFIs = 00000002. Detaching TBF from MS object, TLLI = 0xf1000001, TBF = TBF(TFI=0 TLLI=0xf1000001 DIR=DL STATE=FLOW) ********** TBF ends here ********** -Clearing MS object, TLLI: 0xf1000001, IMSI: '' +Modifying MS object, TLLI = 0xf1000002, IMSI '' -> '001001000000002' +Clearing MS object, TLLI: 0xf1000001, IMSI: '001001000000002' Destroying MS object, TLLI = 0x00000000 TBF(TFI=1 TLLI=0xf1000002 DIR=DL STATE=FLOW) free TBF(TFI=1 TLLI=0xf1000002 DIR=DL STATE=FLOW) Software error: Pending downlink assignment. This may not happen, because the assignment message never gets transmitted. Please be sure not to free in this state. PLEASE FIX! |