aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/smp.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-02-26 16:33:43 -0500
committerMarcel Holtmann <marcel@holtmann.org>2014-02-26 16:46:03 -0500
commit9747a9f31756362e1b9d0b2347c25ae5120c3319 (patch)
treedd7e65e0a9403e66acf8f8b8b19c409c19eb19a7 /net/bluetooth/smp.c
parenta9a58f861218aee89fbe8ed4db054a7eee6f58c2 (diff)
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/smp.c')
-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)
948 if (!(smp->remote_key_dist & SMP_DIST_ENC_KEY)) 948 if (!(smp->remote_key_dist & SMP_DIST_ENC_KEY))
949 return 0; 949 return 0;
950 950
951 /* Mark the information as received */
952 smp->remote_key_dist &= ~SMP_DIST_ENC_KEY;
953
951 skb_pull(skb, sizeof(*rp)); 954 skb_pull(skb, sizeof(*rp));
952 955
953 hci_dev_lock(hdev); 956 hci_dev_lock(hdev);
@@ -1001,6 +1004,9 @@ static int smp_cmd_ident_addr_info(struct l2cap_conn *conn,
1001 if (!(smp->remote_key_dist & SMP_DIST_ID_KEY)) 1004 if (!(smp->remote_key_dist & SMP_DIST_ID_KEY))
1002 return 0; 1005 return 0;
1003 1006
1007 /* Mark the information as received */
1008 smp->remote_key_dist &= ~SMP_DIST_ID_KEY;
1009
1004 skb_pull(skb, sizeof(*info)); 1010 skb_pull(skb, sizeof(*info));
1005 1011
1006 /* Strictly speaking the Core Specification (4.1) allows sending 1012 /* Strictly speaking the Core Specification (4.1) allows sending