aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-12-27 17:29:04 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2018-01-11 11:05:32 +0000
commit188a91c35a843e2eef1c3a7eb6d365963114d851 (patch)
tree1152d74f9b0fdf64c2694fa7a6a7eafbd9310918
parente0ed7d949f3b647282848749381a2ddd1afdbb54 (diff)
gprs_llc: tx dl ud: make mismatching LLE not crash osmo-sgsn
On 34c3, osmo-sgsn keeps restarting. At least once, it hits the assertion that this patch replaces with an error message, to not disrupt operation. Change-Id: I07a40960920dbc594192530c3a145f9a5d2a9c81
-rw-r--r--src/gprs/gprs_llc.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c
index 1a7cf3db8..6c92f8334 100644
--- a/src/gprs/gprs_llc.c
+++ b/src/gprs/gprs_llc.c
@@ -372,8 +372,15 @@ static int _bssgp_tx_dl_ud(struct msgb *msg, struct sgsn_mm_ctx *mmctx)
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->gb.llme->tlli
- || msgb_tlli(msg) == mmctx->gb.llme->old_tlli);
+ if (!(msgb_tlli(msg) == mmctx->gb.llme->tlli
+ || msgb_tlli(msg) == mmctx->gb.llme->old_tlli)) {
+ LOGP(DLLC, LOGL_ERROR,
+ "_bssgp_tx_dl_ud(): Attempt to send Downlink Unitdata to wrong LLME:"
+ " msgb_tlli=0x%x mmctx->gb.llme->tlli=0x%x ->old_tlli=0x%x\n",
+ msgb_tlli(msg), mmctx->gb.llme->tlli, mmctx->gb.llme->old_tlli);
+ msgb_free(msg);
+ return -EINVAL;
+ }
}
memcpy(&dup.qos_profile, qos_profile_default,
sizeof(qos_profile_default));