aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tbf.cpp')
-rw-r--r--src/tbf.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 680a096a..05b61404 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -53,7 +53,22 @@ void gprs_rlcmac_tbf::assign_imsi(const char *imsi)
void gprs_rlcmac_tbf::set_new_tbf(gprs_rlcmac_tbf *tbf)
{
+ if (m_new_tbf) {
+ if (m_new_tbf == tbf) {
+ LOGP(DRLCMAC, LOGL_NOTICE,
+ "%s reassigning %s to m_new_tbf\n",
+ tbf_name(this), tbf_name(tbf));
+ return;
+ }
+ LOGP(DRLCMAC, LOGL_NOTICE,
+ "%s m_new_tbf is already assigned to %s, "
+ "overwriting the old value with %s\n",
+ tbf_name(this), tbf_name(m_new_tbf), tbf_name(tbf));
+ /* Detach from other TBF */
+ m_new_tbf->m_old_tbf = NULL;
+ }
m_new_tbf = tbf;
+ tbf->m_old_tbf = this;
}
gprs_rlcmac_ul_tbf *tbf_alloc_ul(struct gprs_rlcmac_bts *bts,
@@ -138,6 +153,28 @@ void tbf_free(struct gprs_rlcmac_tbf *tbf)
else
tbf->bts->tbf_dl_freed();
+ if (tbf->m_old_tbf) {
+ LOGP(DRLCMAC, LOGL_INFO, "%s Old TBF %s still exists, detaching\n",
+ tbf_name(tbf), tbf_name(tbf->m_old_tbf));
+ if (tbf->m_old_tbf->m_new_tbf == tbf)
+ tbf->m_old_tbf->m_new_tbf = NULL;
+ else
+ LOGP(DRLCMAC, LOGL_ERROR, "%s Software error: "
+ "tbf->m_old_tbf->m_new_tbf != tbf\n",
+ tbf_name(tbf));
+ }
+
+ if (tbf->m_new_tbf) {
+ LOGP(DRLCMAC, LOGL_INFO, "%s New TBF %s still exists, detaching\n",
+ tbf_name(tbf), tbf_name(tbf->m_new_tbf));
+ if (tbf->m_new_tbf->m_old_tbf == tbf)
+ tbf->m_new_tbf->m_old_tbf = NULL;
+ else
+ LOGP(DRLCMAC, LOGL_ERROR, "%s Software error: "
+ "tbf->m_new_tbf->m_old_tbf != tbf\n",
+ tbf_name(tbf));
+ }
+
LOGP(DRLCMAC, LOGL_DEBUG, "********** TBF ends here **********\n");
talloc_free(tbf);
}