From b9d3c71af347906cef2bb54be57418a948d17b14 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Fri, 5 Oct 2018 10:23:41 +0200 Subject: 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 --- src/osmo-bsc/gsm_08_08.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3