diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2022-10-31 12:48:41 +0100 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2022-10-31 22:07:31 +0100 |
commit | 76363e43346386500e98e2f07acc956747d37e4c (patch) | |
tree | b52284a216faf3ab24c0fa81055f7c37a9bedbd0 | |
parent | 9438613792bd28adadb12c23eca2d196f3e0e65b (diff) |
update_ms(): Set TLLI of new MS object before merge with old MS
This way it becomes clearer in logs that we are merging MS which
contains the same TLLI.
Change-Id: Ifd232daa4219e1726c30449d647312a3a226a61d
-rw-r--r-- | src/tbf.cpp | 13 | ||||
-rw-r--r-- | tests/tbf/TbfTest.err | 4 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp index 58695d26..dfed320d 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -215,6 +215,8 @@ void gprs_rlcmac_tbf::set_ms(GprsMs *ms) void gprs_rlcmac_tbf::update_ms(uint32_t tlli, enum gprs_rlcmac_tbf_direction dir) { + GprsMs *old_ms = NULL; + if (tlli == GSM_RESERVED_TMSI) return; @@ -222,18 +224,17 @@ void gprs_rlcmac_tbf::update_ms(uint32_t tlli, enum gprs_rlcmac_tbf_direction di * MS object that belongs to that TLLI and if yes make sure one of them * gets deleted. This is the same problem that can arise with * IMSI in dl_tbf_handle() so there should be a unified solution */ - if (!ms_check_tlli(ms(), tlli)) { - GprsMs *old_ms; - + if (!ms_check_tlli(ms(), tlli)) old_ms = bts_ms_store(bts)->get_ms(tlli, GSM_RESERVED_TMSI, NULL); - if (old_ms) - ms_merge_and_clear_ms(ms(), old_ms); - } if (dir == GPRS_RLCMAC_UL_TBF) ms_set_tlli(ms(), tlli); else ms_confirm_tlli(ms(), tlli); + + if (old_ms) + ms_merge_and_clear_ms(ms(), old_ms); + /* old_ms may no longer be available here */ } static void tbf_unlink_pdch(struct gprs_rlcmac_tbf *tbf) diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index bde79402..fe7b628e 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -2655,6 +2655,7 @@ TBF(TFI=0 TLLI=0xffffffff DIR=UL STATE=FLOW) Got CS-1 RLC data block: CV=0, BSN= TBF(TFI=0 TLLI=0xffffffff DIR=UL STATE=FLOW) BSN 0 storing in window (0..63) TBF(TFI=0 TLLI=0xffffffff DIR=UL STATE=FLOW) data_length=20, data=f1 22 33 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 TBF(TFI=0 TLLI=0xffffffff DIR=UL STATE=FLOW) Decoded premier TLLI=0xf1223344 of UL DATA TFI=0. +Modifying MS object, UL TLLI: 0xffffffff -> 0xf1223344, not yet confirmed TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) free PDCH(bts=0,trx=0,ts=7) Detaching TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN), 1 TBFs, USFs = 01, TFIs = 00000001. MS(TLLI=0xf1223344, IMSI=0011223344, TA=7, 1/0,) Detaching TBF: TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) @@ -2662,10 +2663,9 @@ MS(TLLI=0xf1223344, IMSI=0011223344, TA=7, 1/0,) Detaching TBF: TBF(TFI=0 TLLI=0 TBF(DL-TFI_0){ASSIGN}: Deallocated UL_ASS_TBF(DL-TFI_0){NONE}: Deallocated DL_ASS_TBF(DL-TFI_0){NONE}: Deallocated -Modifying MS object, TLLI = 0xffffffff, MS class 0 -> 1 +Modifying MS object, TLLI = 0xf1223344, MS class 0 -> 1 MS(TLLI=0xf1223344, IMSI=0011223344, TA=7, 1/0,) Clearing MS object MS(TLLI=0xffffffff, IMSI=, TA=7, 1/0,) Destroying MS object -Modifying MS object, UL TLLI: 0xffffffff -> 0xf1223344, not yet confirmed TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Assembling frames: (len=20) TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Frame 1 starts at offset 4, length=16, is_complete=1 TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) complete UL frame len=16 |