From: Andre Guedes <andre.guedes@openbossa.org>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH] Fix EIR parsing in evt_le_advertising_report_dump
Date: Tue, 4 Oct 2011 19:55:07 -0300 [thread overview]
Message-ID: <1317768907-24106-1-git-send-email-andre.guedes@openbossa.org> (raw)
Only the first EIR data structure from the LE advertising report
event is dumped. This patch fix this, so all EIR data structure
present in that event is dumped.
---
parser/hci.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/parser/hci.c b/parser/hci.c
index 610177b..698a301 100644
--- a/parser/hci.c
+++ b/parser/hci.c
@@ -3534,6 +3534,7 @@ static inline void evt_le_advertising_report_dump(int level, struct frame *frm)
while (num_reports--) {
char addr[18];
le_advertising_info *info = frm->ptr;
+ int offset = 0;
p_ba2str(&info->bdaddr, addr);
@@ -3544,9 +3545,12 @@ static inline void evt_le_advertising_report_dump(int level, struct frame *frm)
printf("bdaddr %s (%s)\n", addr,
bdaddrtype2str(info->bdaddr_type));
- if (info->length > 0) {
- ext_inquiry_data_dump(level, frm,
- ((uint8_t *) &info->length) + 1);
+ while (offset < info->length) {
+ int eir_data_len = info->data[offset];
+
+ ext_inquiry_data_dump(level, frm, &info->data[offset]);
+
+ offset += eir_data_len + 1;
}
frm->ptr += LE_ADVERTISING_INFO_SIZE + info->length;
--
1.7.5.2
next reply other threads:[~2011-10-04 22:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-04 22:55 Andre Guedes [this message]
2011-10-10 7:08 ` [PATCH] Fix EIR parsing in evt_le_advertising_report_dump Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1317768907-24106-1-git-send-email-andre.guedes@openbossa.org \
--to=andre.guedes@openbossa.org \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox