diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-08-20 17:28:33 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2018-08-20 17:31:58 +0200 |
commit | 236d1d486541c58131f6282b50158602a32992b7 (patch) | |
tree | b8f1163442f7067ab9ce45666d1e5f2baf30c8da | |
parent | 2d3fae7e3699ba339d83464ee4c67cbe76cd167d (diff) |
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
-rw-r--r-- | src/iu_helpers.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |