tbf: Always call set_tlli/confirm_tlli in update_ms
Currently the m_tlli member in GprsMs is set by the constructor,
circumventing the TLLI confirmation mechanism.
This commit replaces the get_or_create_ms() method by a create_ms()
method which takes the TLLI and the direction (UL or DL) as
parameters to select either set_tlli() or confirm_tlli(). The MS
object is instantiated with TLLI = 0, and therefore GprsMs::tlli() is
extended to return the DL TLLI if both of the other TLLI are not set.
Note that create_ms() will not check whether an MS object with a
matching TLLI is already stored in the list, so it should only be
called after a corresponding get_ms() in general.
Sponsored-by: On-Waves ehf
diff --git a/src/gprs_ms.h b/src/gprs_ms.h
index ac1928e..e84ff9e 100644
--- a/src/gprs_ms.h
+++ b/src/gprs_ms.h
@@ -89,7 +89,9 @@
inline uint32_t GprsMs::tlli() const
{
- return m_new_ul_tlli ? m_new_ul_tlli : m_tlli;
+ return m_new_ul_tlli ? m_new_ul_tlli :
+ m_tlli ? m_tlli :
+ m_new_dl_tlli;
}
inline bool GprsMs::check_tlli(uint32_t tlli)