Attention is currently required from: laforge, pespin.

dexter 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:

(1 comment)

File src/libmsc/sgs_iface.c:

https://gerrit.osmocom.org/c/osmo-msc/+/43237/comment/b057d7f7_005a88c9?usp=email
 :
PS6, Line 192:  osmo_apn_to_str(mme_name, mme_name_enc, mme_name_enc_len);
> if we end up here, does it makes sense to previously have checked "if 
> (mme_name_enc_len >= mme_name_ […]
The check in line 176 is still valid. The only difference between the two 
formats is only the delimiter. The gpp format uses a dot as delimiter and the 
IETF format uses a one byte length field.

But let's take a closer look:
SGS_MME_NAME_LEN = 55

The URL as per 3gpp TS 23.003 looks like this. The URL is 54 bytes long, so I 
assume we have defined SGS_MME_NAME_LEN to accommodate for the string 
terminator. (This would also mean that the sgs_iface.c code is a bit unclean 
now since we add another string terminator byte, but that is a different story).

mmec00.mmegi0000.mme.epc.mncMNC.mccMCC.3gppnetwork.org0

(the string terminator in the TLV object is actually a length byte that is set 
to 0, see NOTE in 3GPP TS 23.003, section 19.4.2.1)

Now let's hold this against the RFC-1035, section 3.1 format. I have added 'L' 
to mark the length fields.

Lmmec00Lmmegi0000LmmeLepcLmncMNCLmccMCCL3gppnetwork.org

So both end up with the same length, which mean both will pass the minimum 
length test and the maximum length test. Apart from the fact that our code now 
wastes one byte everything should be fine.



--
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 <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-Attention: laforge <[email protected]>
Gerrit-Attention: pespin <[email protected]>
Gerrit-Comment-Date: Tue, 18 Aug 2026 16:09:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <[email protected]>

Reply via email to