Attention is currently required from: fixeria, laforge, pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/34899?usp=email )
Change subject: client: collapse codecs[] and ptmap[]; allow codec variants
......................................................................
Patch Set 11:
(3 comments)
This change is ready for review.
File include/osmocom/mgcp_client/mgcp_client.h:
https://gerrit.osmocom.org/c/osmo-mgw/+/34899/comment/dda640dc_a61a6d04
PS10, Line 82: int ptmap_cmp(const struct ptmap *a, const struct ptmap *b);
> yes, it is const ... […]
Done
File include/osmocom/mgcp_client/mgcp_client_fsm.h:
https://gerrit.osmocom.org/c/osmo-mgw/+/34899/comment/cc913811_dab6ce00
PS10, Line 33: enum mgcp_codecs codecs[MGCP_MAX_CODECS];
> IIRC you can mark fields with the OSMO_DEPRECATED flag, this way it shows up in gcc when used by any […]
Done
File src/libosmo-mgcp-client/mgcp_client_fsm.c:
https://gerrit.osmocom.org/c/osmo-mgw/+/34899/comment/8731a67a_b2b77bd4
PS10, Line 700: struct osmo_fsm_inst *mgcp_conn_create(struct mgcp_client *mgcp, struct osmo_fsm_inst *parent_fi,
> I would remove it from the .h, make it a static function. […]
Done
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/34899?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: I798e02c6663376d3d52f4a74fc4b32411ce95bed
Gerrit-Change-Number: 34899
Gerrit-PatchSet: 11
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 22 Dec 2023 02:17:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
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