neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/35421?usp=email )
Change subject: client SDP: more verbose error logging
......................................................................
client SDP: more verbose error logging
So far it was pure guess work to find out why a message fails.
Change-Id: Ibc6343db82281789004c140ba98d99e5f6f73d83
---
M src/libosmo-mgcp-client/mgcp_client.c
1 file changed, 27 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/21/35421/1
diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c
index 8df65cd..489ce69 100644
--- a/src/libosmo-mgcp-client/mgcp_client.c
+++ b/src/libosmo-mgcp-client/mgcp_client.c
@@ -329,20 +329,31 @@
errno = 0;
pt = strtoul(pt_str, &pt_end, 0);
if ((errno == ERANGE && pt == ULONG_MAX) || (errno && !pt) ||
- pt_str == pt_end)
+ pt_str == pt_end) {
+ LOGP(DLMGCP, LOGL_ERROR, "SDP: cannot parse payload type number from '%s'\n", pt_str);
goto response_parse_failure_pt;
+ }
- if (pt >> 7) /* PT is 7 bit field, higher values not allowed */
+ /* PT is 7 bit field, higher values not allowed */
+ if (pt >> 7) {
+ LOGP(DLMGCP, LOGL_ERROR, "SDP: payload type number out of range: %lu > 127\n", pt);
goto response_parse_failure_pt;
+ }
/* Do not allow duplicate payload types */
- for (i = 0; i < ptmap_len; i++)
- if (r->ptmap[i].pt == pt)
+ for (i = 0; i < ptmap_len; i++) {
+ if (r->ptmap[i].pt == pt) {
+ LOGP(DLMGCP, LOGL_ERROR, "SDP: payload type number %lu listed twice\n", pt);
goto response_parse_failure_pt;
+ }
+ }
/* Do not allow excessive payload types */
- if (ptmap_len >= ARRAY_SIZE(r->ptmap))
+ if (ptmap_len >= ARRAY_SIZE(r->ptmap)) {
+ LOGP(DLMGCP, LOGL_ERROR,
+ "SDP: can parse only up to %zu payload type numbers\n", ARRAY_SIZE(r->ptmap));
goto response_parse_failure_pt;
+ }
/* Some payload type numbers imply a specific codec. For those, using the PT number as enum mgcp_codecs
* yields the correct result. If no more specific information on the codec follows in "a=rtpmap:N"
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/35421?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Ibc6343db82281789004c140ba98d99e5f6f73d83
Gerrit-Change-Number: 35421
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/35420?usp=email )
Change subject: client: allow MGCP_MAX_CODECS entries
......................................................................
client: allow MGCP_MAX_CODECS entries
So far we allow only MGCP_MAX_CODECS-1 entries, because the parsing exit
condition hits only after the array size check. Instead, check the array
size a bit later, just before actually adding a valid entry.
This is verified to work as expected in upcoming patch
I842ce65a9a70f313570857b7df53727cc572b9e6 that adds a new
mgcp_client_test.c section for this.
Change-Id: I9a28da85e437f118026ea71a5a708e5758fff623
---
M src/libosmo-mgcp-client/mgcp_client.c
1 file changed, 21 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/20/35420/1
diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c
index 60c54a6..8df65cd 100644
--- a/src/libosmo-mgcp-client/mgcp_client.c
+++ b/src/libosmo-mgcp-client/mgcp_client.c
@@ -323,10 +323,6 @@
pt_str = strtok(line, " ");
while (1) {
- /* Do not allow excessive payload types */
- if (ptmap_len >= ARRAY_SIZE(r->ptmap))
- goto response_parse_failure_pt;
-
pt_str = strtok(NULL, " ");
if (!pt_str)
break;
@@ -344,6 +340,10 @@
if (r->ptmap[i].pt == pt)
goto response_parse_failure_pt;
+ /* Do not allow excessive payload types */
+ if (ptmap_len >= ARRAY_SIZE(r->ptmap))
+ goto response_parse_failure_pt;
+
/* Some payload type numbers imply a specific codec. For those, using the PT number as enum mgcp_codecs
* yields the correct result. If no more specific information on the codec follows in "a=rtpmap:N"
* lines, then this default number takes over. This only applies for PT below the dynamic range (<96). */
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/35420?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I9a28da85e437f118026ea71a5a708e5758fff623
Gerrit-Change-Number: 35420
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: laforge.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/35415?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: fix encode/decode of xPLMNwAcT
......................................................................
fix encode/decode of xPLMNwAcT
There are some pretty intricate rules about how GSM and E-UTRAN are
encoded, let's make sure we fully support both as per 3GPP TS 31.102
Release 17. As part of this, swithc from a list of access technologies
to a set, as there is no order.
Change-Id: I398ac2a2527bd11e9c652e49fa46d6ca8d334b88
---
M pySim/ts_51_011.py
M pySim/utils.py
M pysim-testdata/Fairwaves-SIM.ok
M pysim-testdata/Wavemobile-SIM.ok
M pysim-testdata/sysmoISIM-SJA2.ok
M pysim-testdata/sysmoUSIM-SJS1.ok
M tests/test_utils.py
7 files changed, 62 insertions(+), 44 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/15/35415/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35415?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I398ac2a2527bd11e9c652e49fa46d6ca8d334b88
Gerrit-Change-Number: 35415
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newpatchset
laforge has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/pysim/+/35416?usp=email )
Change subject: 31.102 + 51.011: Fix encode/decode of EF.CFIS
......................................................................
31.102 + 51.011: Fix encode/decode of EF.CFIS
The EF.CFIS definition is not identical to EF.ADN, so we cannot recycle
the EF.ADN class to decode EF.CFIS.
Change-Id: Idcab35cbe28332e3c8612bcb90226335b48ea973
---
M pySim/ts_31_102.py
M pySim/ts_51_011.py
2 files changed, 36 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/16/35416/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35416?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Idcab35cbe28332e3c8612bcb90226335b48ea973
Gerrit-Change-Number: 35416
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-CC: Jenkins Builder
Gerrit-MessageType: newpatchset
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/35415?usp=email )
Change subject: fix encode/decode of xPLMNwAcT
......................................................................
Patch Set 1:
(1 comment)
File pySim/utils.py:
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-13207):
https://gerrit.osmocom.org/c/pysim/+/35415/comment/7b3c566e_f4d98986
PS1, Line 497: # only the simple single-bit ones
trailing whitespace
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35415?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I398ac2a2527bd11e9c652e49fa46d6ca8d334b88
Gerrit-Change-Number: 35415
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Thu, 21 Dec 2023 19:27:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/35417?usp=email )
Change subject: test/test_files: set maxDiff attribute
......................................................................
test/test_files: set maxDiff attribute
Without this the diff between expected and actual output is truncated
and one instead reads the following output:
Diff is 844 characters long. Set self.maxDiff to None to see it.
We actually want to see the full diff to see what's not matching.
Change-Id: I6e89705061454191b6db1255de7fe549ad720800
---
M tests/test_files.py
1 file changed, 20 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/17/35417/1
diff --git a/tests/test_files.py b/tests/test_files.py
index fe520fb..47c08af 100755
--- a/tests/test_files.py
+++ b/tests/test_files.py
@@ -37,6 +37,7 @@
class LinFixed_Test(unittest.TestCase):
classes = all_subclasses(LinFixedEF)
+ maxDiff = None
def test_decode_record(self):
"""Test the decoder for a linear-fixed EF. Requires the given LinFixedEF subclass
@@ -124,6 +125,7 @@
class TransRecEF_Test(unittest.TestCase):
classes = all_subclasses(TransRecEF)
+ maxDiff = None
def test_decode_record(self):
"""Test the decoder for a transparent record-oriented EF. Requires the given TransRecEF subclass
@@ -186,6 +188,8 @@
class TransparentEF_Test(unittest.TestCase):
+ maxDiff = None
+
@classmethod
def get_classes(cls):
"""get list of TransparentEF sub-classes which are not a TransRecEF subclass."""
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35417?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I6e89705061454191b6db1255de7fe549ad720800
Gerrit-Change-Number: 35417
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange