From: Johan Hedberg <johan.hedberg@gmail.com>
To: Jakub Pawlowski <jpawlowski@google.com>
Cc: BlueZ development <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH v1 1/2] Bluetooth: Move address type check for hci_conn_params
Date: Tue, 30 Jun 2015 21:34:46 +0300 [thread overview]
Message-ID: <20150630183446.GA18938@t440s> (raw)
In-Reply-To: <CAD0=r8xhkPSsWYiZH4BQP_xNp8A1W0GiHgk8BCbvi5RC0VM6SQ@mail.gmail.com>
Hi Jakub,
On Tue, Jun 30, 2015, Jakub Pawlowski wrote:
> On Tue, Jun 30, 2015 at 4:55 AM, Johan Hedberg <johan.hedberg@gmail.com> wrote:
> > Hi Jakub,
> >
> > On Wed, Jun 24, 2015, Jakub Pawlowski wrote:
> >> @@ -2822,10 +2822,6 @@ struct hci_conn_params *hci_conn_params_lookup(struct hci_dev *hdev,
> >> {
> >> struct hci_conn_params *params;
> >>
> >> - /* The conn params list only contains identity addresses */
> >> - if (!hci_is_identity_address(addr, addr_type))
> >> - return NULL;
> >> -
> >> list_for_each_entry(params, &hdev->le_conn_params, list) {
> >> if (bacmp(¶ms->addr, addr) == 0 &&
> >> params->addr_type == addr_type) {
> >> @@ -2842,10 +2838,6 @@ struct hci_conn_params *hci_pend_le_action_lookup(struct list_head *list,
> >> {
> >> struct hci_conn_params *param;
> >>
> >> - /* The list only contains identity addresses */
> >> - if (!hci_is_identity_address(addr, addr_type))
> >> - return NULL;
> >> -
> >> list_for_each_entry(param, list, action) {
> >> if (bacmp(¶m->addr, addr) == 0 &&
> >> param->addr_type == addr_type)
> >
> > Both of the above could be called for HCI events related to non-paired
> > devices that use private addresses. In such a case these identity
> > address checks would prevent unnecessary iteration of the (potentially
> > long) list. Do we really want to remove them?
>
> Right now hci_conn_params struct can be used only for identity
> addresses. In upcoming patches I want to use it as piece of connect
> mechanism for all addresses, including RPA's. For that reason I have
> to remove this check. I can also create new structure, or separate
> list and use it for new connect mechanism, what do you think ?
Ok, now I understand. You *want* to have RPAs in the lists. I have a
feeling that using the same list will in the end result in the simplest
code. You just need to make sure that these entries don't stay there
forever and that they are appropriately updated with the identity
address info if we receive it from the remote during pairing.
Johan
next prev parent reply other threads:[~2015-06-30 18:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-24 23:34 [PATCH v1 1/2] Bluetooth: Move address type check for hci_conn_params Jakub Pawlowski
2015-06-24 23:34 ` [PATCH v1 2/2] Bluetooth: Fix connection to already paired device Jakub Pawlowski
2015-06-26 18:57 ` Marcel Holtmann
2015-06-29 18:05 ` Jakub Pawlowski
2015-06-26 18:44 ` [PATCH v1 1/2] Bluetooth: Move address type check for hci_conn_params Marcel Holtmann
2015-06-30 11:55 ` Johan Hedberg
2015-06-30 15:04 ` Jakub Pawlowski
2015-06-30 18:34 ` Johan Hedberg [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-06-24 23:32 Jakub Pawlowski
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=20150630183446.GA18938@t440s \
--to=johan.hedberg@gmail.com \
--cc=jpawlowski@google.com \
--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;
as well as URLs for NNTP newsgroup(s).