GPRS LLC: fix segfault when transmitting downlink unit-data without mmctx

This commit is contained in:
Harald Welte 2012-07-04 21:53:12 +02:00
parent ad66a2d150
commit 8c00496e42
1 changed files with 10 additions and 5 deletions

View File

@ -43,11 +43,16 @@ static int _bssgp_tx_dl_ud(struct msgb *msg, struct sgsn_mm_ctx *mmctx)
struct bssgp_dl_ud_par dup; struct bssgp_dl_ud_par dup;
const uint8_t qos_profile_default[3] = { 0x00, 0x00, 0x20 }; const uint8_t qos_profile_default[3] = { 0x00, 0x00, 0x20 };
dup.tlli = NULL; memset(&dup, 0, sizeof(dup));
dup.imsi = mmctx->imsi; /* before we have received some identity from the MS, we might
dup.drx_parms = mmctx->drx_parms; * not yet have a MMC context (e.g. XID negotiation of primarly
dup.ms_ra_cap.len = mmctx->ms_radio_access_capa.len; * LLC connection fro GMM sapi). */
dup.ms_ra_cap.v = mmctx->ms_radio_access_capa.buf; 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;
}
memcpy(&dup.qos_profile, qos_profile_default, memcpy(&dup.qos_profile, qos_profile_default,
sizeof(qos_profile_default)); sizeof(qos_profile_default));