From 236d1d486541c58131f6282b50158602a32992b7 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 20 Aug 2018 17:28:33 +0200 Subject: fix decoding of incoming X.213 NSAP addr Fix ranap_transp_layer_addr_decode() to test == 7 instead of > 7: If a femto cell sends its Transport Layer Address as X.213 NSAP IPv4, we receive 3 header bytes and four IP-address bytes, so the length is exactly 7. This function is very vague on numerous other decoding details, but this patch only fixes the vital length check that makes 3G usable with X.213 NSAP. Related: OS#3420 Change-Id: I2cd1b2d8e1c1ae707cfc0dc7961a2b31ecdf29e0 --- 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 5e78293..39b0521 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