aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs_ms.cpp
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-07-18 12:50:18 +0200
committerHarald Welte <laforge@gnumonks.org>2016-09-09 06:37:04 +0000
commit9bbe1600cc02e1b538380393edb1dcdabe9247a2 (patch)
tree2f129366b22e1c5148f958522320bcdf524041e8 /src/gprs_ms.cpp
parent16ddc90eabad423d247753f7d89639659e049d35 (diff)
Fix Timing Advance handling
* initialize with invalid TA instead of making assumption that phone is located within 550 meters (TA=0) * only set valid TA Change-Id: Idfc40ff0c11bdac13d9e28fbfa4e95dfc6b735b0 Related: OS#1526
Diffstat (limited to 'src/gprs_ms.cpp')
-rw-r--r--src/gprs_ms.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp
index b3270b16..8facc505 100644
--- a/src/gprs_ms.cpp
+++ b/src/gprs_ms.cpp
@@ -32,6 +32,7 @@
extern "C" {
#include <osmocom/core/talloc.h>
#include <osmocom/core/utils.h>
+ #include <osmocom/gsm/protocol/gsm_04_08.h>
}
#define GPRS_CODEL_SLOW_INTERVAL_MS 4000
@@ -95,7 +96,7 @@ GprsMs::GprsMs(BTS *bts, uint32_t tlli) :
m_tlli(tlli),
m_new_ul_tlli(0),
m_new_dl_tlli(0),
- m_ta(0),
+ m_ta(GSM48_TA_INVALID),
m_ms_class(0),
m_egprs_ms_class(0),
m_is_idle(true),
@@ -464,11 +465,15 @@ void GprsMs::set_ta(uint8_t ta_)
if (ta_ == m_ta)
return;
- LOGP(DRLCMAC, LOGL_INFO,
- "Modifying MS object, TLLI = 0x%08x, TA %d -> %d\n",
- tlli(), m_ta, ta_);
-
- m_ta = ta_;
+ if (gsm48_ta_is_valid(ta_)) {
+ LOGP(DRLCMAC, LOGL_INFO,
+ "Modifying MS object, TLLI = 0x%08x, TA %d -> %d\n",
+ tlli(), m_ta, ta_);
+ m_ta = ta_;
+ } else
+ LOGP(DRLCMAC, LOGL_NOTICE,
+ "MS object, TLLI = 0x%08x, invalid TA %d rejected (old "
+ "value %d kept)\n", tlli(), ta_, m_ta);
}
void GprsMs::set_ms_class(uint8_t ms_class_)