public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Nick Pelly <npelly@google.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: Keeping ACL link around after DBUS CreateBonding()
Date: Tue, 07 Oct 2008 00:33:55 +0200	[thread overview]
Message-ID: <1223332435.11272.240.camel@violet.holtmann.net> (raw)
In-Reply-To: <35c90d960810061442r5edb776blbdf420ac067e9f9c@mail.gmail.com>

Hi Nick,

> Attached is the btsnoop from the CreateBonding()
> 
> Note the "Create Connection Cancel" right after completing bonding.
> This is what this patch tries to address - allow 2 seconds before
> disconnecting the ACL link instead of 10 ms for this scenario.

so the actual questions is why we end up here:

> HCI Event: Link Key Notification (0x18) plen 23
    bdaddr 00:19:7F:64:DA:C5 key E3E8A7783875D177851DC9F0EEEB474D type 0
    Type: Combination Key
< HCI Command: Create Connection Cancel (0x01|0x0008) plen 6
    bdaddr 00:19:7F:64:DA:C5
< HCI Command: Create Connection Cancel (0x01|0x0008) plen 6
    bdaddr 00:19:7F:64:DA:C5
> HCI Event: Command Complete (0x0e) plen 10
    Create Connection Cancel (0x01|0x0008) ncmd 1
    status 0x00 bdaddr 00:19:7F:64:DA:C5
> HCI Event: Command Complete (0x0e) plen 10
    Create Connection Cancel (0x01|0x0008) ncmd 1
    status 0x00 bdaddr 00:19:7F:64:DA:C5
> HCI Event: Connect Complete (0x03) plen 11
    status 0x02 handle 1 bdaddr 00:19:7F:64:DA:C5 type ACL encrypt 0x01
    Error: Unknown Connection Identifier

The problem is not the kernel since the kernel is doing the right thing
here. If the last user goes away and we haven't established ACL then we
cancel it instead of letting it timeout.

So the CreateBonding is actually broken here. CreateBonding should only
close the L2CAP raw socket (the one we use for bonding), when we get
Auth Complete (in that case 2 seconds apply) or when we get the Link Key
Notification before Connect Complete, it has to wait until Connect
Complete to close it.

Johan, please check if your modified code in 4.x actually does the right
thing for security mode 3. Or if we still have the same issue.

> Also note that the "Create Connection Cancel" takes 40 seconds to
> return from the BRF6300. To me this looks like a unrelated issue with
> the TI chip (and I have a separate conversation going on with TI about
> it).

The double Create Connection Cancel and not rejecting one with an error
code is an issue of the TI chip. It should not allow that. Question
still is why do we send it twice.

Regards

Marcel



      reply	other threads:[~2008-10-06 22:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-03  0:47 Keeping ACL link around after DBUS CreateBonding() Nick Pelly
2008-10-03  6:36 ` Marcel Holtmann
2008-10-03  6:42   ` Nick Pelly
2008-10-03  6:56     ` Marcel Holtmann
2008-10-06 16:18       ` Nick Pelly
2008-10-06 16:26         ` Marcel Holtmann
2008-10-06 21:42           ` Nick Pelly
2008-10-06 22:33             ` Marcel Holtmann [this message]

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=1223332435.11272.240.camel@violet.holtmann.net \
    --to=marcel@holtmann.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=npelly@google.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