diff options
Diffstat (limited to 'src/gsm/tlv_parser.c')
-rw-r--r-- | src/gsm/tlv_parser.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gsm/tlv_parser.c b/src/gsm/tlv_parser.c index de766881..e47b94f1 100644 --- a/src/gsm/tlv_parser.c +++ b/src/gsm/tlv_parser.c @@ -241,7 +241,9 @@ int tlv_parse_one(uint8_t *o_tag, uint16_t *o_len, const uint8_t **o_val, *o_tag = tag; /* single octet TV IE */ - if (def->def[tag & 0xf0].type == TLV_TYPE_SINGLE_TV) { + if (def->def[tag >> 4].type == TLV_TYPE_SINGLE_TV + /* backward compat for old IEs with half-octet tag defined as 0xN0: */ + || ((tag > 0x0f) && (def->def[tag & 0xf0].type == TLV_TYPE_SINGLE_TV))) { *o_tag = tag & 0xf0; *o_val = buf; *o_len = 1; |