Change in libosmocore[master]: ipa_ccm_idtag_parse*: Fix reported length value

Harald Welte gerrit-no-reply at
Tue Mar 19 13:41:49 UTC 2019

Harald Welte has submitted this change and it was merged. ( )

Change subject: ipa_ccm_idtag_parse*: Fix reported length value

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
M src/gsm/ipa.c
1 file changed, 1 insertion(+), 1 deletion(-)

  Neels Hofmeyr: Looks good to me, but someone else must approve
  Max: Looks good to me, but someone else must approve
  osmith: Looks good to me, approved
  Jenkins Builder: Verified

diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c
index d423c26..b6fdc98 100644
--- a/src/gsm/ipa.c
+++ b/src/gsm/ipa.c
@@ -128,7 +128,7 @@
 		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;

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I435aaa33605bd48635715a2c81aa2d231c1abf51
Gerrit-Change-Number: 10216
Gerrit-PatchSet: 4
Gerrit-Owner: Harald Welte <laforge at>
Gerrit-Assignee: Neels Hofmeyr <nhofmeyr at>
Gerrit-Reviewer: Harald Welte <laforge at>
Gerrit-Reviewer: Holger Freyther <holger at>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max <msuraev at>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at>
Gerrit-Reviewer: osmith <osmith at>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list