aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/libmsc')
-rw-r--r--openbsc/src/libmsc/gsm_04_08.c13
-rw-r--r--openbsc/src/libmsc/mncc_sock.c9
2 files changed, 17 insertions, 5 deletions
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index a6ed3e83e..bd452ed99 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -1602,7 +1602,7 @@ static int tch_map(struct gsm_lchan *lchan, struct gsm_lchan *remote_lchan)
remote_bts->nr, remote_lchan->ts->trx->nr, remote_lchan->ts->nr);
if (bts->type != remote_bts->type) {
- DEBUGP(DCC, "Cannot switch calls between different BTS types yet\n");
+ LOGP(DCC, LOGL_ERROR, "Cannot switch calls between different BTS types yet\n");
return -EINVAL;
}
@@ -1634,10 +1634,11 @@ static int tch_map(struct gsm_lchan *lchan, struct gsm_lchan *remote_lchan)
break;
case GSM_BTS_TYPE_BS11:
case GSM_BTS_TYPE_RBS2000:
+ case GSM_BTS_TYPE_NOKIA_SITE:
trau_mux_map_lchan(lchan, remote_lchan);
break;
default:
- DEBUGP(DCC, "Unknown BTS type %u\n", bts->type);
+ LOGP(DCC, LOGL_ERROR, "Unknown BTS type %u\n", bts->type);
return -EINVAL;
}
@@ -1680,7 +1681,7 @@ static int tch_recv_mncc(struct gsm_network *net, uint32_t callref, int enable)
switch (bts->type) {
case GSM_BTS_TYPE_NANOBTS:
if (ipacc_rtp_direct) {
- DEBUGP(DCC, "Error: RTP proxy is disabled\n");
+ LOGP(DCC, LOGL_ERROR, "Error: RTP proxy is disabled\n");
return -EINVAL;
}
/* in case, we don't have a RTP socket yet, we note this
@@ -1704,12 +1705,13 @@ static int tch_recv_mncc(struct gsm_network *net, uint32_t callref, int enable)
break;
case GSM_BTS_TYPE_BS11:
case GSM_BTS_TYPE_RBS2000:
+ case GSM_BTS_TYPE_NOKIA_SITE:
if (enable)
return trau_recv_lchan(lchan, callref);
return trau_mux_unmap(NULL, callref);
break;
default:
- DEBUGP(DCC, "Unknown BTS type %u\n", bts->type);
+ LOGP(DCC, LOGL_ERROR, "Unknown BTS type %u\n", bts->type);
return -EINVAL;
}
@@ -2989,9 +2991,10 @@ int mncc_tx_to_cc(struct gsm_network *net, int msg_type, void *arg)
return rtp_send_frame(trans->conn->lchan->abis_ip.rtp_socket, arg);
case GSM_BTS_TYPE_BS11:
case GSM_BTS_TYPE_RBS2000:
+ case GSM_BTS_TYPE_NOKIA_SITE:
return trau_send_frame(trans->conn->lchan, arg);
default:
- DEBUGP(DCC, "Unknown BTS type %u\n", bts->type);
+ LOGP(DCC, LOGL_ERROR, "Unknown BTS type %u\n", bts->type);
}
return -EINVAL;
}
diff --git a/openbsc/src/libmsc/mncc_sock.c b/openbsc/src/libmsc/mncc_sock.c
index 5ef9922d2..d8caf0754 100644
--- a/openbsc/src/libmsc/mncc_sock.c
+++ b/openbsc/src/libmsc/mncc_sock.c
@@ -165,6 +165,13 @@ static int mncc_sock_write(struct osmo_fd *bfd)
bfd->when &= ~BSC_FD_WRITE;
+ /* bug hunter 8-): maybe someone forgot msgb_put(...) ? */
+ if (!msgb_length(msg)) {
+ LOGP(DMNCC, LOGL_ERROR, "message type (%d) with ZERO "
+ "bytes!\n", mncc_prim->msg_type);
+ goto dontsend;
+ }
+
/* try to send it over the socket */
rc = write(bfd->fd, msgb_data(msg), msgb_length(msg));
if (rc == 0)
@@ -176,6 +183,8 @@ static int mncc_sock_write(struct osmo_fd *bfd)
}
goto close;
}
+
+dontsend:
/* _after_ we send it, we can deueue */
msg2 = msgb_dequeue(&net->upqueue);
assert(msg == msg2);