diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-02-18 21:41:32 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-02-18 11:48:54 -0800 |
commit | 68d6f6ded5bdaa89f9da0144359a7c5565991f8d (patch) | |
tree | 75c7a934746a747aad097e6aca5113a0977ecaca /net/bluetooth/hci_event.c | |
parent | 893ce8b1b3d92cbddcf34bb92c7d24720efc7fed (diff) | |
download | linux-stable-68d6f6ded5bdaa89f9da0144359a7c5565991f8d.tar.gz linux-stable-68d6f6ded5bdaa89f9da0144359a7c5565991f8d.tar.bz2 linux-stable-68d6f6ded5bdaa89f9da0144359a7c5565991f8d.zip |
Bluetooth: Track the LE Identity Address in struct hci_conn
Since we want user space to see and use the LE Identity Address whenever
interfacing with the kernel it makes sense to track that instead of the
real address (the two will only be different in the case of an RPA).
This patch adds the necessary updates to when an LE connection gets
established and when receiving the Identity Address from a remote
device.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r-- | net/bluetooth/hci_event.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index d2c6878a9d6a..49a2d4d841df 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -3568,6 +3568,7 @@ static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) { struct hci_ev_le_conn_complete *ev = (void *) skb->data; struct hci_conn *conn; + struct smp_irk *irk; BT_DBG("%s status 0x%2.2x", hdev->name, ev->status); @@ -3600,6 +3601,13 @@ static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) } } + /* Track the connection based on the Identity Address from now on */ + irk = hci_get_irk(hdev, &ev->bdaddr, ev->bdaddr_type); + if (irk) { + bacpy(&conn->dst, &irk->bdaddr); + conn->dst_type = irk->addr_type; + } + if (ev->status) { mgmt_connect_failed(hdev, &conn->dst, conn->type, conn->dst_type, ev->status); |