]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Bluetooth: Fix LE vs BR/EDR selection when connecting
authorJohan Hedberg <johan.hedberg@intel.com>
Mon, 29 Apr 2013 16:35:36 +0000 (19:35 +0300)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Fri, 3 May 2013 19:09:42 +0000 (16:09 -0300)
The choice between LE and BR/EDR should be made on the destination
address type instead of the destination CID. This is particularly
important when in the future more than one CID will be allowed for LE.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
net/bluetooth/l2cap_core.c

index f706ba189878ff83dced52ddae2676a2d51e0e01..f27a3f376a40b6908d0dee4b0a88214e7e941cca 100644 (file)
@@ -1792,7 +1792,7 @@ int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid,
 
        auth_type = l2cap_get_auth_type(chan);
 
-       if (chan->dcid == L2CAP_CID_ATT)
+       if (bdaddr_type_is_le(dst_type))
                hcon = hci_connect(hdev, LE_LINK, dst, dst_type,
                                   chan->sec_level, auth_type);
        else