This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Max gerrit-no-reply at lists.osmocom.orgReview at https://gerrit.osmocom.org/547 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 --- M src/gprs_ms.cpp M src/sba.cpp M src/tbf.cpp 3 files changed, 18 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/47/547/1 diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp index b3270b1..8facc50 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 @@ 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 @@ 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_) diff --git a/src/sba.cpp b/src/sba.cpp index 6aeeb7c..46c1431 100644 --- a/src/sba.cpp +++ b/src/sba.cpp @@ -26,6 +26,7 @@ extern "C" { #include <osmocom/core/talloc.h> +#include <osmocom/gsm/protocol/gsm_04_08.h> } #include <errno.h> @@ -55,6 +56,9 @@ if (!sba) return -ENOMEM; + if (!gsm48_ta_is_valid(ta)) + return -EINVAL; + for (trx = 0; trx < 8; trx++) { for (ts = 7; ts >= 0; ts--) { pdch = &m_bts.bts_data()->trx[trx].pdch[ts]; diff --git a/src/tbf.cpp b/src/tbf.cpp index 1fc1aef..7a15547 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -74,7 +74,7 @@ m_tfi(0), m_created_ts(0), m_ms(NULL), - m_ta(0), + m_ta(GSM48_TA_INVALID), m_ms_class(0), m_list(this), m_ms_list(this), @@ -151,7 +151,8 @@ if (ms()) ms()->set_ta(ta); - m_ta = ta; + if (gsm48_ta_is_valid(ta)) + m_ta = ta; } uint8_t gprs_rlcmac_tbf::ms_class() const -- To view, visit https://gerrit.osmocom.org/547 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idfc40ff0c11bdac13d9e28fbfa4e95dfc6b735b0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max <msuraev at sysmocom.de>