]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: Check L2CAP pending status before sending connect request
authorAndrei Emeltchenko <andrei.emeltchenko@nokia.com>
Thu, 8 Jul 2010 09:14:41 +0000 (12:14 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 8 Jul 2010 23:35:23 +0000 (20:35 -0300)
commitba1226d422a0fa7d13e45fa86c5259b31bfa7d0e
tree8f1489e92272e18cc5c222283bcbeccfe7bcecd2
parent266a613c0dfbc00cf7a82fd44faf98b3d042a7b3
Bluetooth: Check L2CAP pending status before sending connect request

Due to race condition in L2CAP state machine L2CAP Connection Request
may be sent twice for SDP with the same source channel id. Problems
reported connecting to Apple products, some carkit, Blackberry phones.

...
2010-06-07 21:18:03.651031 < ACL data: handle 1 flags 0x02 dlen 12
    L2CAP(s): Connect req: psm 1 scid 0x0040
2010-06-07 21:18:03.653473 > HCI Event: Number of Completed Packets (0x13) plen 5
    handle 1 packets 1
2010-06-07 21:18:03.653808 > HCI Event: Auth Complete (0x06) plen 3
    status 0x00 handle 1
2010-06-07 21:18:03.653869 < ACL data: handle 1 flags 0x02 dlen 12
    L2CAP(s): Connect req: psm 1 scid 0x0040
...

Patch uses L2CAP_CONF_CONNECT_PEND flag to mark that L2CAP Connection
Request has been sent already.

Modified version of patch from Ville Tervo.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/l2cap.c