generate shorter 'I:' conn IDs

Reduce the number of hex chars generated as Connection Identifier from 32 to 8.

According to RFC3435 "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
Neels Hofmeyr 5 years ago
parent 5336f57f05
commit a729db62a9

@ -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)
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.