diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2013-10-13 10:25:18 -0400 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-10-13 10:48:29 -0400 |
commit | 880be4e8d0db86a635b87f75fee7daa4f6006f45 (patch) | |
tree | 900b4237f83b02be80a54be88410714dfbc589c8 /net/bluetooth/hci_event.c | |
parent | 662e8820f38dcc458e0d4769194db5ed3469224f (diff) |
Bluetooth: Update source address and type for incoming LE connections
The incoming LE connections do not have a proper source address and
address type set. The connection needs to be set with the same values
as used for advertising parameters.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r-- | net/bluetooth/hci_event.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index bbe2d292c4a9..aa6fed3a553b 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -3477,6 +3477,17 @@ static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) | |||
3477 | 3477 | ||
3478 | conn->dst_type = ev->bdaddr_type; | 3478 | conn->dst_type = ev->bdaddr_type; |
3479 | 3479 | ||
3480 | /* The advertising parameters for own address type | ||
3481 | * define which source address and source address | ||
3482 | * type this connections has. | ||
3483 | */ | ||
3484 | if (bacmp(&conn->src, BDADDR_ANY)) { | ||
3485 | conn->src_type = ADDR_LE_DEV_PUBLIC; | ||
3486 | } else { | ||
3487 | bacpy(&conn->src, &hdev->static_addr); | ||
3488 | conn->src_type = ADDR_LE_DEV_RANDOM; | ||
3489 | } | ||
3490 | |||
3480 | if (ev->role == LE_CONN_ROLE_MASTER) { | 3491 | if (ev->role == LE_CONN_ROLE_MASTER) { |
3481 | conn->out = true; | 3492 | conn->out = true; |
3482 | conn->link_mode |= HCI_LM_MASTER; | 3493 | conn->link_mode |= HCI_LM_MASTER; |