[layer23] Don't request a channel, if SYSINFO 3 is not available
authorAndreas.Eversberg <jolly@eversberg.eu>
Wed, 20 Oct 2010 18:16:12 +0000 (18:16 +0000)
committerAndreas.Eversberg <jolly@eversberg.eu>
Wed, 20 Oct 2010 18:16:12 +0000 (18:16 +0000)
SI3 is required in order to request a channel the correct way. If not
yet received, the process crashes due to an arithmetic exception.

src/host/layer23/src/mobile/gsm48_rr.c

index ffabde9..78c9931 100644 (file)
@@ -1451,7 +1451,7 @@ int gsm48_rr_tx_rand_acc(struct osmocom_ms *ms, struct msgb *msg)
 
        if (cs->ccch_state != GSM322_CCCH_ST_DATA) {
                LOGP(DRR, LOGL_INFO, "CCCH channel activation failed.\n");
-
+fail:
                if (rr->rr_est_req) {
                        struct msgb *msg =
                                gsm48_rr_msgb_alloc(GSM48_RR_REL_IND);
@@ -1470,6 +1470,11 @@ int gsm48_rr_tx_rand_acc(struct osmocom_ms *ms, struct msgb *msg)
                return 0;
        }
 
+       if (!s || !s->si3 || !s->tx_integer) {
+               LOGP(DRR, LOGL_NOTICE, "Not enough SYSINFO\n");
+               goto fail;
+       }
+
        if (rr->state == GSM48_RR_ST_IDLE) {
                LOGP(DRR, LOGL_INFO, "MM already released RR.\n");