From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx> Country code is also included in the TLV size. --- parser/l2cap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parser/l2cap.c b/parser/l2cap.c index 056e2a6..f6ed91d 100644 --- a/parser/l2cap.c +++ b/parser/l2cap.c @@ -1168,7 +1168,7 @@ static void a2mp_dump_chanlist(int level, struct a2mp_tlv *tlv, char *prefix) struct a2mp_country_triplet *triplet; int i, num; - num = tlv->len / sizeof(*triplet); + num = (tlv->len - sizeof(*chan_list)) / sizeof(*triplet); printf("%s number of triplets %d\n", prefix, num); -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html