summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-10-17 10:08:02 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-01-19 15:10:58 +0100
commitdd399a0da4f3d78ff980c8b2e741119fa1991319 (patch)
tree67b0fd49709f2072e7c8f438077964648f6ae882
parentb25cd3064cf4c613ed19633657071ea2a9668582 (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 0b4613e..c2c65d9 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));