summaryrefslogtreecommitdiffstats
path: root/src/gsm/ipa.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-07-28 21:37:06 +0200
committerHarald Welte <laforge@gnumonks.org>2019-03-19 13:41:49 +0000
commit1261db15058cfa94615f26c1083bb8a38d09218b (patch)
treea7d7e6e45b0429c961da919168bb185e9cd5cf7d /src/gsm/ipa.c
parentfb6f43ee0c6a288e036ca616a29f6b7485d426c6 (diff)
ipa_ccm_idtag_parse*: Fix reported length value
IPA CCM is using a somewhat weird TLV encoding scheme: * 16bit length (of tag and value) * 8bit tag * value Our existing code mapping the CCM to 'struct tlv_parse' used the plain length value without accounting for the one-byte tag. This patch ensures we only report the length of the "value" part, excluding the tag. Change-Id: I435aaa33605bd48635715a2c81aa2d231c1abf51
Diffstat (limited to 'src/gsm/ipa.c')
-rw-r--r--src/gsm/ipa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c
index d423c262..b6fdc985 100644
--- a/src/gsm/ipa.c
+++ b/src/gsm/ipa.c
@@ -128,7 +128,7 @@ int ipa_ccm_idtag_parse_off(struct tlv_parsed *dec, unsigned char *buf, int len,
DEBUGPC(DLMI, "%s='%s' ", ipa_ccm_idtag_name(t_tag), cur);
- dec->lv[t_tag].len = t_len - len_offset;
+ dec->lv[t_tag].len = t_len - 1 - len_offset;
dec->lv[t_tag].val = cur;
cur += t_len - len_offset;