From dd399a0da4f3d78ff980c8b2e741119fa1991319 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Fri, 17 Oct 2014 10:08:02 +0200 Subject: 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 --- openbsc/src/gprs/gprs_llc.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'openbsc') 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)); -- cgit v1.2.3