diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2018-10-05 10:23:41 +0200 |
---|---|---|
committer | Philipp Maier <pmaier@sysmocom.de> | 2018-10-05 15:20:51 +0200 |
commit | b9d3c71af347906cef2bb54be57418a948d17b14 (patch) | |
tree | 19fb24aac65e11f01f874f97d72f7483b0f1174d | |
parent | c9a4f697d38b35680938f20928544a734739b185 (diff) |
gsm_08_08: abort complete L3 3 msg gen when no codecs are set
The COMPLETE LAYER 3 INFORMATION message should contain a Codec List
(BSS Supported) IE. The contents of this list depend on the BTS
capabilities and of the MSC configuration (allowed codecs). There may
be cases where (due to miss-configuration) the list is empty. In those
cases the BSC hits an assertion because the encoding of the overall
message fails when the codec list is empty. A check is needed.
- Check codec list before message generation, abort if the coded
list is empty.
Change-Id: I119607047a132b75b3077bbe56c97936d8ae6c96
Related: OS#3625
-rw-r--r-- | src/osmo-bsc/gsm_08_08.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/osmo-bsc/gsm_08_08.c b/src/osmo-bsc/gsm_08_08.c index 807eb8c44..6e1e5029a 100644 --- a/src/osmo-bsc/gsm_08_08.c +++ b/src/osmo-bsc/gsm_08_08.c @@ -495,7 +495,12 @@ static bool complete_layer3(struct gsm_subscriber_connection *conn, if (gscon_is_aoip(conn)) { gen_bss_supported_codec_list(&scl, msc, conn_get_bts(conn)); - resp = gsm0808_create_layer3_2(msg, cgi_for_msc(conn->sccp.msc, conn_get_bts(conn)), &scl); + if (scl.len > 0) + resp = gsm0808_create_layer3_2(msg, cgi_for_msc(conn->sccp.msc, conn_get_bts(conn)), &scl); + else { + LOGP(DMSC, LOGL_ERROR, "Failed to create layer3 message due to empty speech codec list.\n"); + return false; + } } else resp = gsm0808_create_layer3_2(msg, cgi_for_msc(conn->sccp.msc, conn_get_bts(conn)), NULL); |