aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-08-28 16:20:51 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-09-03 23:12:23 +0200
commita729db62a930b931775ce9fd99afe89f1d7066b7 (patch)
tree1733da5c7aa548205dc827f99a3707796f6e2bf7 /src
parent5336f57f05cde9e83b4a671a78d61ffdfc8ce5a6 (diff)
generate shorter 'I:' conn IDs
Reduce the number of hex chars generated as Connection Identifier from 32 to 8. According to RFC3435 2.1.3.2 "Names of Connections", the maximum length is indeed 32 characters, but there isn't really a benefit of using IDs of that size. That, and: A specific SCCPlite MSC is seen to be able to store conn IDs of up to 8 hex characters of length. If given more than that, it will later send 'ffffffff' as ID, e.g. in the DLCX message, causing mismatches and rejected DLCX. Conn IDs need to be unique only within the context of one endpoint, so producing 32 characters of ID is far beyond overkill, especially if we currently expect exactly two IDs per endpoint. Notice that the maximum length of conn ID that can be handled by the message parsing and composition doesn't change, only the length that an osmo-mgw will generate upon CRCX does. Related: OS#3507 Change-Id: Ia290c22a91fca0e5aa44515fca6df00064aff100
Diffstat (limited to 'src')
-rw-r--r--src/libosmo-mgcp/mgcp_conn.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c
index 2a45b814e..0126c7c22 100644
--- a/src/libosmo-mgcp/mgcp_conn.c
+++ b/src/libosmo-mgcp/mgcp_conn.c
@@ -55,10 +55,11 @@ const static struct rate_ctr_group_desc rate_ctr_group_desc = {
* memory for id) */
static int mgcp_alloc_id(struct mgcp_endpoint *endp, char *id)
{
+#define MGCP_CONN_ID_GEN_LEN 8
int i;
int k;
int rc;
- uint8_t id_bin[16];
+ uint8_t id_bin[MGCP_CONN_ID_GEN_LEN / 2];
char *id_hex;
/* Generate a connection id that is unique for the current endpoint.