Attention is currently required from: osmith, pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/29279 )
Change subject: llc: gprs_llc_hdr_parse(): make the input data pointer const
......................................................................
Patch Set 1:
(1 comment)
File src/gprs/gprs_llc_parse.c:
https://gerrit.osmocom.org/c/osmo-sgsn/+/29279/comment/5c75eb8a_83f99ee4
PS1, Line 138: ghp->data = (uint8_t *)&ctrl[3];
> You are also telling the user that calling the function won't make any kind of modification at any time to contents of that address at any time.
Not at any time, but only during the function exec time.
> What if the user passes a const pointer coming from a write-protected memory region?
Then it's still responsibility of the user to not modify a write-protected memory region. There exist functions in glibc internally casting const to non-const, e.g. memchr(), strchr(), or strstr(). Do you also consider them wrong?
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/29279
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I9757d2be5af589ccbe4d3d406637a33690284754
Gerrit-Change-Number: 29279
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 07 Sep 2022 09:46:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: pespin, fixeria.
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/29279 )
Change subject: llc: gprs_llc_hdr_parse(): make the input data pointer const
......................................................................
Patch Set 1:
(1 comment)
File src/gprs/gprs_llc_parse.c:
https://gerrit.osmocom.org/c/osmo-sgsn/+/29279/comment/6103887f_c49caa1f
PS1, Line 138: ghp->data = (uint8_t *)&ctrl[3];
> What if the user passes a const pointer coming from a write-protected memory region?
I agree with Pau, this illustrates well why this is a problem IMHO
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/29279
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I9757d2be5af589ccbe4d3d406637a33690284754
Gerrit-Change-Number: 29279
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 07 Sep 2022 09:37:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29273 )
Change subject: Osmux_Emulation: Add DATA port
......................................................................
Osmux_Emulation: Add DATA port
Similar to what's already present in RTPEM_Emulation, this allows tests
to retrieve the Osmux messages received.
Related: OS#5987
Change-Id: Id9aa3a0a02ef5a5e39b4df8a1c165f35255829ab
---
M library/OSMUX_Emulation.ttcn
1 file changed, 9 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, approved
osmith: Looks good to me, but someone else must approve
diff --git a/library/OSMUX_Emulation.ttcn b/library/OSMUX_Emulation.ttcn
index 10338d2..c6999de 100644
--- a/library/OSMUX_Emulation.ttcn
+++ b/library/OSMUX_Emulation.ttcn
@@ -67,6 +67,8 @@
/* user-facing port for controlling the binding */
port OsmuxEM_CTRL_PT CTRL;
+ /* user-facing port for sniffing Osmux frames */
+ port OsmuxEM_DATA_PT DATA;
/* configurable by user, should be fixed */
var OsmuxemConfig g_cfg := c_OsmuxemDefaultCfg;
@@ -190,6 +192,10 @@
OsmuxEM_stats_get, OsmuxEM_register_rxhandle, OsmuxEM_register_txhandle;
} with { extension "internal" };
+type port OsmuxEM_DATA_PT message {
+ inout OSMUX_PDU;
+} with { extension "internal" };
+
function f_osmuxem_bind(OsmuxEM_CTRL_PT pt, in HostName local_host, inout PortNumber local_port) {
pt.call(OsmuxEM_bind:{local_host, local_port}) {
[] pt.getreply(OsmuxEM_bind:{local_host, ?}) -> param (local_port) {};
@@ -556,6 +562,9 @@
if (ispresent(g_cfg.rx_fixed_payload) and rx_osmux.msg.osmux_amr.data != payload_truncated) {
g_stat.num_pkts_rx_err_payload := g_stat.num_pkts_rx_err_payload + 1;
}
+ if (DATA.checkstate("Connected")) {
+ DATA.send(rx_osmux.msg);
+ }
}
/* process received Osmux Dummy if receiver enabled */
[g_rx_enabled] OSMUX.receive(tr_osmux_dummy) -> value rx_osmux {
3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29273
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id9aa3a0a02ef5a5e39b4df8a1c165f35255829ab
Gerrit-Change-Number: 29273
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged