fix transport layer addr again, for nano3g

The nano3G sends the RAB Assignment Response's Transport Layer Address in X.213
NSAP padded to 20 bytes (160bit). Do not interpret it as 4-byte IP address,
which currently breaks nano3G voice calls (wrong RTP IP address).

Recent commit I2cd1b2d8e1c1ae707cfc0dc7961a2b31ecdf29e0 fixed decoding of X.213
NSAP that is exactly seven bytes, but broke decoding of the padded version from
the nano3G.

A proper X.213 NSAP decoding would still be more welcome than this patching
back and forth, but this is (another) quick fix without spending too much time
on it.

Related: OS#3420
Change-Id: I0ad8bce6fcfd3829394c39490058c1ab85cdfde3
This commit is contained in:
Neels Hofmeyr 2018-09-30 23:35:33 +02:00
parent b876b421e3
commit a770f6967b
1 changed files with 1 additions and 1 deletions

View File

@ -109,7 +109,7 @@ int ranap_transp_layer_addr_decode(char *addr, unsigned int addr_len,
buf = trasp_layer_addr->buf;
len = trasp_layer_addr->size;
if (buf[0] == 0x35 && len == 7)
if (buf[0] == 0x35 && len >= 7)
rc = inet_ntop(AF_INET, buf + 3, addr, addr_len);
else if (len > 3)
rc = inet_ntop(AF_INET, buf, addr, addr_len);