aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2022-02-15 20:06:16 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2022-02-16 12:51:40 +0100
commita87526d53ee1ec8fdd33652f808ca9059551da1e (patch)
treecb9ed7ed6d1bab4120fd43a54f4ca3e2abbc9687
parentcore/utils.h: make use of OSMO_LIKELY in OSMO_ASSERT (diff)
downloadlibosmocore-a87526d53ee1ec8fdd33652f808ca9059551da1e.tar.xz
libosmocore-a87526d53ee1ec8fdd33652f808ca9059551da1e.zip
gsm0808: Test if we properly decode a SRVCC cell identifier list
We don't handle this correctly, as we decided to overload the meaning of 0b1011 in a cell identifier list (defined by 3GPP as used in SRVCC) with something osmocom proprietary. Change-Id: I608220e8e5dd5a44f85c6bc5ea04622a2cad24ec
-rw-r--r--tests/gsm0808/gsm0808_test.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c
index 3fff0053..d0560d5f 100644
--- a/tests/gsm0808/gsm0808_test.c
+++ b/tests/gsm0808/gsm0808_test.c
@@ -1072,6 +1072,18 @@ static void test_gsm0808_enc_dec_encrypt_info()
msgb_free(msg);
}
+static void test_gsm0808_dec_cell_id_list_srvcc()
+{
+ /* taken from a pcap file of a real-world 3rd party MSC (SYS#5838) */
+ const uint8_t enc_cil[] = { 0x0b, 0x2, 0xf2, 0x10, 0x4e, 0x20, 0x15, 0xbe};
+ struct gsm0808_cell_id_list2 dec_cil;
+ int rc;
+
+ rc = gsm0808_dec_cell_id_list2(&dec_cil, enc_cil, sizeof(enc_cil));
+ /* Not yet supported: */
+ OSMO_ASSERT(rc == -EINVAL);
+}
+
static void test_gsm0808_enc_dec_cell_id_list_lac()
{
struct gsm0808_cell_id_list2 enc_cil;
@@ -2490,6 +2502,7 @@ int main(int argc, char **argv)
test_gsm0808_enc_dec_cell_id_list_multi_ci();
test_gsm0808_enc_dec_cell_id_list_multi_lac_and_ci();
test_gsm0808_enc_dec_cell_id_list_multi_global();
+ test_gsm0808_dec_cell_id_list_srvcc();
test_cell_id_list_add();