laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/43237?usp=email )
Change subject: sgs_iface: clean up code in function decode_mme_name
......................................................................
sgs_iface: clean up code in function decode_mme_name
The function decode_mme_name is a bit hard to read and also has
some minor problems we can optimize.
- Do not call TLVP_LEN each time we need the length of the
TLV IE. Call it once and keep the value in a variable.
- mme_name_enc holds the value part of the TLV IE, we can
use this variable instead of calling TLVP_VAL all all
the time.
- When we have copied the value part of the TLV IE using
memset, let's ensure that the string is terminated.
- Add/fix spec references and improve comments so that it
is more clear how the decoding actually works.
Related: OS#7058
Change-Id: I9aec8300f15264b68ac8e7805e93e621b12cafb2
---
M src/libmsc/sgs_iface.c
1 file changed, 17 insertions(+), 7 deletions(-)
Approvals:
laforge: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/src/libmsc/sgs_iface.c b/src/libmsc/sgs_iface.c
index 4425a93..db9246c 100644
--- a/src/libmsc/sgs_iface.c
+++ b/src/libmsc/sgs_iface.c
@@ -162,27 +162,37 @@
/* Decode and verify MME name */
static int decode_mme_name(char *mme_name, size_t mme_name_len, const struct tlv_parsed *tp)
{
+ /* The MME name is a fixed length FQDN (e.g. mmec00.mmegi0000.mme.epc.mncMNC.mccMCC.3gppnetwork.org,
+ * see also 3GPP TS 23.003, section 19.4.2.1 and 3GPP TS 29.118, section 9.4.13 */
const uint8_t *mme_name_enc = TLVP_VAL_MINLEN(tp, SGSAP_IE_MME_NAME, SGS_MME_NAME_LEN);
+ size_t mme_name_enc_len = TLVP_LEN(tp, SGSAP_IE_MME_NAME);
struct osmo_gummei gummei;
if (!mme_name_enc)
return -EINVAL;
- /* do not accept over-long SGSAP_IE_MME_NAME IEs which would exceed the length
+ /* Do not accept over-long SGSAP_IE_MME_NAME IEs which would exceed the length
* of the output buffer. */
- if (TLVP_LEN(tp, SGSAP_IE_MME_NAME) >= mme_name_len)
+ if (mme_name_enc_len >= mme_name_len)
return -EINVAL;
- /* some implementations use FDQN format violating TS 29.118 9.3.14 */
+ /* We attempt to parse the MME name into a GUMMEI to make sure it has the form
+ * specified by 3GPP TS 29.118, section 9.4.13. In that case, we may copy the
+ * MME name to the output buffer and exit. */
if (!osmo_parse_mme_domain(&gummei, (const char *) mme_name_enc)) {
- memcpy(mme_name, mme_name_enc, TLVP_LEN(tp, SGSAP_IE_MME_NAME));
+ memcpy(mme_name, mme_name_enc, mme_name_enc_len);
+ mme_name[mme_name_enc_len] = '\0';
return 0;
}
- /* decode the MME name from DNS labels to string */
- osmo_apn_to_str(mme_name, TLVP_VAL(tp, SGSAP_IE_MME_NAME), TLVP_LEN(tp, SGSAP_IE_MME_NAME));
+ /* In some cases the MME name may be supplied in the domain name format specified
+ * by RFC-1035, section 3.1, which is a spec violation we want to tolerate. We
+ * may convert the domain name from the LV representtaion into the string string
+ * representation required by 3GPP TS 29.118, section 9.4.13 */
+ osmo_apn_to_str(mme_name, mme_name_enc, mme_name_enc_len);
- /* try to parse the MME name into a GUMMEI as a test for the format */
+ /* To make sure the format conversion has produced a valid MME name, we attempt to
+ * parse the output buffer again. */
if (osmo_parse_mme_domain(&gummei, mme_name) < 0)
return -EINVAL;
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/43237?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I9aec8300f15264b68ac8e7805e93e621b12cafb2
Gerrit-Change-Number: 43237
Gerrit-PatchSet: 7
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Attention is currently required from: dexter.
laforge has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/osmo-msc/+/43237?usp=email )
Change subject: sgs_iface: clean up code in function decode_mme_name
......................................................................
Patch Set 6: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/43237?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I9aec8300f15264b68ac8e7805e93e621b12cafb2
Gerrit-Change-Number: 43237
Gerrit-PatchSet: 6
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Sat, 22 Aug 2026 08:13:09 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43314?usp=email )
Change subject: Fix possible race conditions in RemsimServer_Tests
......................................................................
Fix possible race conditions in RemsimServer_Tests
Some tests sporadically fail. The slotmap is expected to be in ACTIVE
state, but it is sometimes still in the UNACKNOWLEDGED state. The log
output of osmo-remsim-server shows that the state always changes from
UNACKNOWLEDGED to ACTIVE. So there actually no failure.
It is quite likely that the state change is checked too early. The
acknowledged of the bankd seems not to be processed yet. Add a delay to
ensure that the acknowledgment has been processed before checking the
slotmap state.
Related: OS#6996
Change-Id: If5ec1ecd5689414252a73a2787e10495e23e4d30
---
M remsim/RemsimServer_Tests.ttcn
1 file changed, 15 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/remsim/RemsimServer_Tests.ttcn b/remsim/RemsimServer_Tests.ttcn
index de2c478..2fd420e 100644
--- a/remsim/RemsimServer_Tests.ttcn
+++ b/remsim/RemsimServer_Tests.ttcn
@@ -406,6 +406,9 @@
/* 6) expect bankd to receive that mapping */
as_rspro_create_mapping(1, sm.client, sm.bank);
+ /* An immediate slotmaps check may causes a race condition. */
+ f_sleep(1.0);
+
/* 7) verify that the slotmap exists and is ACTIVE */
f_ensure_slotmap_exists_only(sm.client, sm.bank, ACTIVE);
@@ -451,6 +454,9 @@
/* 6) expect bankd to receive that mapping */
as_rspro_create_mapping(1, sm.client, sm.bank);
+ /* An immediate slotmaps check may causes a race condition. */
+ f_sleep(1.0);
+
/* 7) verify that the slotmap exists and is ACTIVE */
f_ensure_slotmap_exists_only(sm.client, sm.bank, ACTIVE);
@@ -544,6 +550,9 @@
/* expect the slotmap to be pushed to bank and ACK it */
as_rspro_create_mapping(0, sm.client, sm.bank);
+ /* An immediate slotmaps check may causes a race condition. */
+ f_sleep(1.0);
+
/* verify that the slotmap exists and is ACTIVE */
f_ensure_slotmap_exists_only(sm.client, sm.bank, ACTIVE);
@@ -595,6 +604,9 @@
/* expect the slotmap to be pushed to bank and ACK it */
as_rspro_create_mapping(0, sm.client, sm.bank);
+ /* An immediate slotmaps check may causes a race condition. */
+ f_sleep(1.0);
+
/* verify that the slotmap exists and is ACTIVE */
f_ensure_slotmap_exists_only(sm.client, sm.bank, ACTIVE);
@@ -642,6 +654,9 @@
/* expect the slotmap to be pushed to bank and ACK it */
as_rspro_create_mapping(0, sm.client, sm.bank);
+ /* An immediate slotmaps check may causes a race condition. */
+ f_sleep(1.0);
+
/* verify that the slotmap exists and is ACTIVE */
f_ensure_slotmap_exists_only(sm.client, sm.bank, ACTIVE);
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43314?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If5ec1ecd5689414252a73a2787e10495e23e4d30
Gerrit-Change-Number: 43314
Gerrit-PatchSet: 3
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Attention is currently required from: neels.
laforge has posted comments on this change by neels. ( https://gerrit.osmocom.org/c/pysim/+/42155?usp=email )
Change subject: esim/http_json_api.py: support text/plain response Content-Type
......................................................................
Patch Set 3:
(2 comments)
Patchset:
PS2:
> Or optionally, When instantiating the object there could be a parameter modifying the behaviour, so […]
no feedback regarding those comments?
Patchset:
PS3:
no response
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/42155?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Iba6e4cef1048b376050a435a900c0f395655a790
Gerrit-Change-Number: 42155
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Comment-Date: Sat, 22 Aug 2026 08:08:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Attention is currently required from: neels.
laforge has posted comments on this change by neels. ( https://gerrit.osmocom.org/c/pysim/+/43290?usp=email )
Change subject: ts_31_102.py: EF_SUCI_Calc_Info(TransparentEF): fix len test
......................................................................
Patch Set 3: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/43290?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ia4e2356d0241d7a6ca399ba7e8be7f27ec836104
Gerrit-Change-Number: 43290
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Comment-Date: Sat, 22 Aug 2026 08:06:41 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: neels.
laforge has posted comments on this change by neels. ( https://gerrit.osmocom.org/c/pysim/+/43288?usp=email )
Change subject: test_configurable_parameters: test less templates
......................................................................
Patch Set 3: Code-Review+1
(1 comment)
Patchset:
PS3:
how long is "long"? Is it really at the scale where we need to reduce testing?
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/43288?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ib75b6919a3acfddd99bf9baa9b6847ef731b9e67
Gerrit-Change-Number: 43288
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Comment-Date: Sat, 22 Aug 2026 08:06:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Attention is currently required from: neels.
laforge has posted comments on this change by neels. ( https://gerrit.osmocom.org/c/pysim/+/43287?usp=email )
Change subject: saip BatchPersonalization: call rebuild_mandatory_services()
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
Patchset:
PS1:
I don't see how we'd ever need to rebuild the mandatory service list on a _per profile_ basis. Shouldn't that be modified once and be identical for all of the profiles in one personalization job? It's not like we can have 10 profiles with different mandatory services in one job?
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/43287?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I5e6eef0f1845a25cddb03af8d16c40e305bcdc1f
Gerrit-Change-Number: 43287
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Comment-Date: Sat, 22 Aug 2026 08:05:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes