From: Johan Hedberg <johan.hedberg@gmail.com>
To: vishal agarwal <vishal.bluez@gmail.com>
Cc: Vishal Agarwal <vishal.agarwal@stericsson.com>,
linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] Bluetooth: eir_append_data should take care of padding
Date: Wed, 25 Apr 2012 15:10:10 +0300 [thread overview]
Message-ID: <20120425121010.GA6085@x220.ger.corp.intel.com> (raw)
In-Reply-To: <CA+_sZW_w5wZePmECvgrPkQy8vPPm=MKEQ3kYhRfPcwaA3cofQQ@mail.gmail.com>
Hi Vishal,
On Wed, Apr 25, 2012, vishal agarwal wrote:
> > On Wed, Apr 25, 2012, vishal agarwal wrote:
> >> In function mgmt_device_found, which is called from
> >> hci_extended_inquiry_result_evt eir_append_data function is called
> >> without taking care of padding bytes. I will create a new function
> >> which will return the padding offset in the EIR data andit will be
> >> called in function mgmt_device_found before calling the
> >> eir_append_data function.
> >
> > That's indeed a bug but please do it in hci_extended_inquiry_result_evt
> > since in the LE case the mgmt_device_found already gets the right
> > parameter value and we'd be needlessly trying to find the offset for LE
> > events.
>
> I was thinking of doing it inside the
> if (dev_class && !eir_has_data_type(ev->eir, eir_len, EIR_CLASS_OF_DEV)) {
>
> }
> it will help us doing it only when needed(no class of device inside EIR data).
> And also in case of BLE dev_class is NULL so it will not go inside if.
> and also code will be more clear.
> what do you think?
That's still wrong since the value of ev->eir_len will be wrong if the
class isn't appended in the if-branch. The mgmt_ev_device_found event is
not supposed to contain a non-significant padded part (which is why it's
got the eir_len field). So please add the offset lookup before calling
mgmt_device_found.
Johan
next prev parent reply other threads:[~2012-04-25 12:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-25 7:51 [PATCH] Bluetooth: eir_append_data should take care of padding Vishal Agarwal
2012-04-25 9:05 ` Johan Hedberg
2012-04-25 9:57 ` vishal agarwal
2012-04-25 10:14 ` Johan Hedberg
2012-04-25 12:00 ` vishal agarwal
2012-04-25 12:10 ` Johan Hedberg [this message]
2012-04-25 9:59 ` vishal agarwal
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=20120425121010.GA6085@x220.ger.corp.intel.com \
--to=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=vishal.agarwal@stericsson.com \
--cc=vishal.bluez@gmail.com \
/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