<p>Neels Hofmeyr has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/10676">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">generate shorter 'I:' conn IDs<br><br>Reduce the number of hex chars generated as Connection Identifier from 32 to 8.<br><br>According to RFC3435 2.1.3.2 "Names of Connections", the maximum length is<br>indeed 32 characters, but there isn't really a benefit of using IDs of that<br>size. That, and:<br><br>A specific SCCPlite MSC is seen to be able to store conn IDs of up to 8 hex<br>characters of length. If given more than that, it will later send 'ffffffff' as<br>ID, e.g. in the DLCX message, causing mismatches and rejected DLCX.<br><br>Conn IDs need to be unique only within the context of one endpoint, so<br>producing 32 characters of ID is far beyond overkill, especially if we<br>currently expect exactly two IDs per endpoint.<br><br>The nicer solution would be to make the length of generated ID configurable,<br>but it would also require some code refactoring to handle a variable length of<br>ID internally. We can safely and simply go with a fixed length of 8 chars.<br><br>Related: OS#3507<br>Change-Id: Ia290c22a91fca0e5aa44515fca6df00064aff100<br>---<br>M include/osmocom/mgcp/mgcp_common.h<br>M src/libosmo-mgcp/mgcp_conn.c<br>2 files changed, 2 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/76/10676/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/mgcp/mgcp_common.h b/include/osmocom/mgcp/mgcp_common.h</span><br><span>index b2c7370..0be227f 100644</span><br><span>--- a/include/osmocom/mgcp/mgcp_common.h</span><br><span>+++ b/include/osmocom/mgcp/mgcp_common.h</span><br><span>@@ -81,7 +81,7 @@</span><br><span> </span><br><span> /* String length of Connection Identifiers</span><br><span>  * (see also RFC3435 2.1.3.2 Names of Connections) */</span><br><span style="color: hsl(0, 100%, 40%);">-#define MGCP_CONN_ID_LENGTH 32+1</span><br><span style="color: hsl(120, 100%, 40%);">+#define MGCP_CONN_ID_LENGTH 8+1</span><br><span> </span><br><span> /* String length of Endpoint Identifiers.</span><br><span> /  (see also RFC3435 section 3.2.1.3) */</span><br><span>diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c</span><br><span>index 3a5db0f..8d855f2 100644</span><br><span>--- a/src/libosmo-mgcp/mgcp_conn.c</span><br><span>+++ b/src/libosmo-mgcp/mgcp_conn.c</span><br><span>@@ -58,7 +58,7 @@</span><br><span>        int i;</span><br><span>       int k;</span><br><span>       int rc;</span><br><span style="color: hsl(0, 100%, 40%);">- uint8_t id_bin[16];</span><br><span style="color: hsl(120, 100%, 40%);">+   uint8_t id_bin[4];</span><br><span>   char *id_hex;</span><br><span> </span><br><span>    /* Generate a connection id that is unique for the current endpoint.</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10676">change 10676</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/10676"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-mgw </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ia290c22a91fca0e5aa44515fca6df00064aff100 </div>
<div style="display:none"> Gerrit-Change-Number: 10676 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>