aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-09-30 23:35:33 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-09-30 23:35:35 +0200
commita770f6967b1b1ca765251cbafc149d0451335202 (patch)
tree1eed2d8dece4b4754cfdfa9d8acd36a246f7333c
parentb876b421e347c1d2346ef69455f8f87088881565 (diff)
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
-rw-r--r--src/iu_helpers.c2
1 files changed, 1 insertions, 1 deletions
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);