aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-10-17 10:08:02 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2014-11-03 13:02:31 +0100
commit3e1697246a2727b2f36e5edbbc7ce8e5f4f57532 (patch)
treee97f6292f0b7074b0ceda5058a4828e3aa6c4099
parentb104ab158e9eb914e0303bc2f965a2f4d68ad372 (diff)
sgsn: Do not die in _bssgp_tx_dl_ud on TLLI mismatch (TODO)
Currently an OSMO_ASSERT fails, if the message's and the mmctx's TLLIs do not match. This commit turns the assertion into an ERROR log message and uses the default values for IMSI, DRX, and RA CAP instead of the MM context values in this case. TODO: - find the real source for the problem - add test cases derived from what is being described in the ticket Ticket: OW#1322 Sponsored-by: On-Waves ehf
-rw-r--r--openbsc/src/gprs/gprs_llc.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/openbsc/src/gprs/gprs_llc.c b/openbsc/src/gprs/gprs_llc.c
index 0b4613e0f..c2c65d951 100644
--- a/openbsc/src/gprs/gprs_llc.c
+++ b/openbsc/src/gprs/gprs_llc.c
@@ -65,16 +65,27 @@ static int _bssgp_tx_dl_ud(struct msgb *msg, struct sgsn_mm_ctx *mmctx)
* not yet have a MMC context (e.g. XID negotiation of primarly
* LLC connection fro GMM sapi). */
if (mmctx) {
- dup.imsi = mmctx->imsi;
- dup.drx_parms = mmctx->drx_parms;
- dup.ms_ra_cap.len = mmctx->ms_radio_access_capa.len;
- dup.ms_ra_cap.v = mmctx->ms_radio_access_capa.buf;
-
/* make sure we only send it to the right llme */
- OSMO_ASSERT(msgb_tlli(msg) == mmctx->llme->tlli
- || msgb_tlli(msg) == mmctx->llme->old_tlli
- || tlli_foreign2local(msgb_tlli(msg)) == mmctx->llme->tlli
- || tlli_foreign2local(msgb_tlli(msg)) == mmctx->llme->old_tlli);
+ if (msgb_tlli(msg) != mmctx->llme->tlli &&
+ msgb_tlli(msg) != mmctx->llme->old_tlli &&
+ tlli_foreign2local(msgb_tlli(msg)) != mmctx->llme->tlli &&
+ tlli_foreign2local(msgb_tlli(msg)) != mmctx->llme->old_tlli)
+ {
+ LOGP(DLLC, LOGL_ERROR,
+ "MM context TLLI mismatch when sending DL unitdata, "
+ "msg TLLI = %08x, ctx TLLI = %08x, "
+ "ctx old TLLI = %08x. "
+ "Using default values for IMSI, DRX, RA CAP\n",
+ msgb_tlli(msg),
+ mmctx->llme->tlli,
+ mmctx->llme->old_tlli);
+ osmo_log_backtrace(DLLC, LOGL_INFO);
+ } else {
+ dup.imsi = mmctx->imsi;
+ dup.drx_parms = mmctx->drx_parms;
+ dup.ms_ra_cap.len = mmctx->ms_radio_access_capa.len;
+ dup.ms_ra_cap.v = mmctx->ms_radio_access_capa.buf;
+ }
}
memcpy(&dup.qos_profile, qos_profile_default,
sizeof(qos_profile_default));