summaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg2014-02-26 22:33:43 +0100
committerMarcel Holtmann2014-02-26 22:46:03 +0100
commit9747a9f31756362e1b9d0b2347c25ae5120c3319 (patch)
treedd7e65e0a9403e66acf8f8b8b19c409c19eb19a7 /net/bluetooth
parentBluetooth: Ignore IRKs with no Identity Address (diff)
downloadkernel-qcow2-linux-9747a9f31756362e1b9d0b2347c25ae5120c3319.tar.gz
kernel-qcow2-linux-9747a9f31756362e1b9d0b2347c25ae5120c3319.tar.xz
kernel-qcow2-linux-9747a9f31756362e1b9d0b2347c25ae5120c3319.zip
Bluetooth: Track not yet received keys in SMP
To make is easier to track which keys we've received and which ones we're still waiting for simply clear the corresponding key bits from smp->remote_key_dist as they get received. This will allow us to simplify the code for checking for SMP completion in subsequent patches. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/smp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 50355d045992..fe41df5c320c 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -948,6 +948,9 @@ static int smp_cmd_master_ident(struct l2cap_conn *conn, struct sk_buff *skb)
if (!(smp->remote_key_dist & SMP_DIST_ENC_KEY))
return 0;
+ /* Mark the information as received */
+ smp->remote_key_dist &= ~SMP_DIST_ENC_KEY;
+
skb_pull(skb, sizeof(*rp));
hci_dev_lock(hdev);
@@ -1001,6 +1004,9 @@ static int smp_cmd_ident_addr_info(struct l2cap_conn *conn,
if (!(smp->remote_key_dist & SMP_DIST_ID_KEY))
return 0;
+ /* Mark the information as received */
+ smp->remote_key_dist &= ~SMP_DIST_ID_KEY;
+
skb_pull(skb, sizeof(*info));
/* Strictly speaking the Core Specification (4.1) allows sending