path: root/src/tbf.cpp
diff options
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-09-01 11:06:14 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-09-01 11:48:26 +0200
commit9659d593073dfb6711f2ed9ad7bee4ca454db784 (patch)
treedf4786b5969625fd04d16720d41e35c41411e6ac /src/tbf.cpp
parentcf6ae9d12f9bf406a8f164f8109410d01328d913 (diff)
tbf: Keep the old MS object alive in extract_tlli
Currently when a second MS object has been created for an MS, because the TLLI was not known yet, the will be detected in gprs_rlcmac_tbf::extract_tlli and the two objects will be merged by update_ms. But when the dl_tbf is moved from the old to the new (second) MS object, the old MS object can get idle and be removed before the object are merged. This can cause LLC frame loss when the MS object is deleted immediately after getting idle (no timeout configured). This commit adds a guard to keep the MS object until extract_tlli has been executed. Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/tbf.cpp')
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 59877543..42d522bd 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -986,6 +986,8 @@ int gprs_rlcmac_tbf::extract_tlli(const uint8_t *data, const size_t len)
old_ms = bts->ms_by_tlli(new_tlli);
+ /* Keep the old MS object for the update_ms() */
+ GprsMs::Guard guard(old_ms);
if (old_ms) {
/* Get them before calling set_ms() */
dl_tbf = old_ms->dl_tbf();
@@ -996,7 +998,7 @@ int gprs_rlcmac_tbf::extract_tlli(const uint8_t *data, const size_t len)
/* there might be an active and valid downlink TBF */
if (!ms()->dl_tbf() && dl_tbf)
- /* Move it to the current MS */
+ /* Move it to the current MS (see the guard above) */