Bluetooth: Fix setting correct src_type when connecting LE
authorJohan Hedberg <johan.hedberg@intel.com>
Sun, 23 Feb 2014 17:42:28 +0000 (19:42 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 23 Feb 2014 20:24:26 +0000 (12:24 -0800)
This patch ensures that conn->src_type contains the same address type as
is used for initiating the connection while the connection attempt is in
progress. Once connected this value will be overwritten with the
identity address type.

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

index 4cb337d6401fc41b5e107b195fde21a0672132ba..a1efa1c62de88130aa0f09a4c11b2d444cd929f6 100644 (file)
@@ -567,6 +567,8 @@ static int hci_create_le_conn(struct hci_conn *conn)
        if (err < 0)
                return err;
 
+       conn->src_type = own_addr_type;
+
        cp.scan_interval = cpu_to_le16(hdev->le_scan_interval);
        cp.scan_window = cpu_to_le16(hdev->le_scan_window);
        bacpy(&cp.peer_addr, &conn->dst);
@@ -653,7 +655,6 @@ static struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
                return ERR_PTR(-ENOMEM);
 
        conn->dst_type = dst_type;
-       conn->src_type = hdev->own_addr_type;
 
        conn->state = BT_CONNECT;
        conn->out = true;