<p><a href="https://gerrit.osmocom.org/c/libosmocore/+/21534">View Change</a></p><p>2 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/21534/1/src/gsm/tlv_parser.c">File src/gsm/tlv_parser.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/21534/1/src/gsm/tlv_parser.c@641">Patch Set #1, Line 641:</a> <code style="font-family:monospace,monospace">      } else {</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">IIRC get_value_string can already return a similar "unknown 0x%x" string, so you can probably drop t […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">but the pdef->msgt_names is optional, by intention.  The value_string for message type is no longer needed with this new API.  Instead, we have a more efficient way by looking up pdef->msg_def[x].name without any linear iteration.  However, since most existing protocols have those old value_string arrays, we keep the option until everything is eventually converted.  So the else-clause-with-snprintf is needed.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/21534/1/src/gsm/tlv_parser.c@690">Patch Set #1, Line 690:</a> <code style="font-family:monospace,monospace">            min_len = pdef->ie_def[i].min_len;</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">May it make sense to instead have a min_len max_len range? with some special value NO_MAX_LEN 0xffff […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I think in general it's ok to simply ignore any extraneous length.  Sure, one could make it even tighter, but I also think some IEs are getting longer and longer in each 3GPP release of the spec, so checking for a maximum length might be detrimental to future compatibility.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/21534">change 21534</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmocore/+/21534"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: If1e1d9adfa141ca86001dbd62a6a339f9bf9a912 </div>
<div style="display:none"> Gerrit-Change-Number: 21534 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-CC: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 04 Dec 2020 17:58:03 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>