summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gsm/tlv_parser.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gsm/tlv_parser.c b/src/gsm/tlv_parser.c
index 9b1fb17a..b8c7149f 100644
--- a/src/gsm/tlv_parser.c
+++ b/src/gsm/tlv_parser.c
@@ -276,8 +276,13 @@ int tlv_parse(struct tlv_parsed *dec, const struct tlv_definition *def,
&buf[ofs], buf_len-ofs);
if (rv < 0)
return rv;
- dec->lv[tag].val = val;
- dec->lv[tag].len = len;
+ /* Most GSM related protocols clearly indicate that in case of duplicate
+ * IEs, only the first occurrence shall be used, while any further occurrences
+ * shall be ignored. See e.g. 3GPP TS 24.008 Section 8.6.3 */
+ if (dec->lv[tag].val == NULL) {
+ dec->lv[tag].val = val;
+ dec->lv[tag].len = len;
+ }
ofs += rv;
num_parsed++;
}