Bluetooth: 6lowpan: Use hci_conn_hash_lookup_le() when possible
authorJohan Hedberg <johan.hedberg@intel.com>
Wed, 21 Oct 2015 15:03:02 +0000 (18:03 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 21 Oct 2015 16:39:16 +0000 (18:39 +0200)
Use the new hci_conn_hash_lookup_le() API to look up LE connections.
This way we're guaranteed exact matches that also take into account
the address type.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/6lowpan.c

index 4057d6e..d85af23 100644 (file)
@@ -1113,7 +1113,7 @@ static int get_l2cap_conn(char *buf, bdaddr_t *addr, u8 *addr_type,
                return -ENOENT;
 
        hci_dev_lock(hdev);
-       hcon = hci_conn_hash_lookup_ba(hdev, LE_LINK, addr);
+       hcon = hci_conn_hash_lookup_le(hdev, addr, *addr_type);
        hci_dev_unlock(hdev);
 
        if (!hcon)