From a770f6967b1b1ca765251cbafc149d0451335202 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Sun, 30 Sep 2018 23:35:33 +0200 Subject: 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 --- src/iu_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iu_helpers.c b/src/iu_helpers.c index 39b0521..bf82fde 100644 --- a/src/iu_helpers.c +++ b/src/iu_helpers.c @@ -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); -- cgit v1.2.3