mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-10-23 08:12:01 +00:00
bsc_msc_ip.c: Crash fix when the MSC disconnects
Check if we do have the msc_data before invoking code in bssap.c. We might have lost the MSC connection and asked for the channel to be taken down but we might have received one last message from the BTS.
This commit is contained in:
@@ -297,6 +297,11 @@ static int handle_cipher_m_complete(struct msgb *msg)
|
||||
{
|
||||
struct msgb *resp;
|
||||
|
||||
if (!msg->lchan->msc_data) {
|
||||
LOGP(DMSC, LOGL_ERROR, "No MSC data for CIPHER MODE COMPLETE.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
DEBUGP(DMSC, "CIPHER MODE COMPLETE from MS, forwarding to MSC\n");
|
||||
resp = bssmap_create_cipher_complete(msg);
|
||||
if (!resp) {
|
||||
@@ -320,7 +325,7 @@ static int handle_ass_compl(struct msgb *msg)
|
||||
DEBUGP(DMSC, "ASSIGNMENT COMPLETE from MS, forwarding to MSC\n");
|
||||
|
||||
if (!msg->lchan->msc_data) {
|
||||
DEBUGP(DMSC, "No MSC data\n");
|
||||
LOGP(DMSC, LOGL_ERROR, "No MSC data\n");
|
||||
put_lchan(msg->lchan, 0);
|
||||
return -1;
|
||||
}
|
||||
@@ -367,7 +372,7 @@ static int handle_ass_fail(struct msgb *msg)
|
||||
|
||||
DEBUGP(DMSC, "ASSIGNMENT FAILURE from MS, forwarding to MSC\n");
|
||||
if (!msg->lchan->msc_data) {
|
||||
DEBUGP(DMSC, "No MSC data\n");
|
||||
LOGP(DMSC, LOGL_ERROR, "No MSC data\n");
|
||||
put_lchan(msg->lchan, 0);
|
||||
return -1;
|
||||
}
|
||||
@@ -398,6 +403,11 @@ static int handle_modify_ack(struct msgb *msg)
|
||||
{
|
||||
int rc;
|
||||
|
||||
if (!msg->lchan->msc_data) {
|
||||
LOGP(DMSC, LOGL_ERROR, "No MSC data for modify ack.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* modify RSL */
|
||||
rc = gsm48_rx_rr_modif_ack(msg);
|
||||
if (rc < 0)
|
||||
|
Reference in New Issue
Block a user