aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/bsc-nat/bsc_nat_test.c
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2019-04-23 16:58:52 +0200
committerDaniel Willmann <dwillmann@sysmocom.de>2019-04-23 17:18:16 +0200
commitbe0e831fa33a2590348952ed35df5e9b9b8caf85 (patch)
tree83e82c31915743d85240dafd4c7d5b2170399f76 /openbsc/tests/bsc-nat/bsc_nat_test.c
parent86950a3754b3beabde8d3f69286d0dd7cacecc4e (diff)
osmo-bsc_nat: Parse MGCP Connection ID as hex
Our ttcn3-bscnat-tests would randomly fail. After the CRCX ACK returns from the MSC the bsc-nat reports it could not find a CI it it and deletes the connection on the BSC-side. This happens because the field is parsed as a decimal value instead of hexadecimal. So a value of 00FED122 is parsed as '0' which is a reserved value in our program. This fix parses the field as hexadecimal value and also logs an error if the value happens to be 0. make check will now test if a hexadecimal CI is parsed correctly. Fixes: OS#3951 Change-Id: I49b8b61644bf706162102dce268cae2265536fc5
Diffstat (limited to 'openbsc/tests/bsc-nat/bsc_nat_test.c')
-rw-r--r--openbsc/tests/bsc-nat/bsc_nat_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/openbsc/tests/bsc-nat/bsc_nat_test.c
index 2914a01b5..e0d0051ba 100644
--- a/openbsc/tests/bsc-nat/bsc_nat_test.c
+++ b/openbsc/tests/bsc-nat/bsc_nat_test.c
@@ -683,7 +683,7 @@ static void test_mgcp_parse(void)
}
ci = bsc_mgcp_extract_ci(crcx_resp);
- if (ci != 1) {
+ if (ci != 0x0F) {
printf("Failed to parse the CI. Got: %d\n", ci);
abort();
}