aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-03-14 04:53:50 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-03-14 12:05:24 -0400
commitfdcc4beccb52f752799978c4da0dcd0faadbdcd4 (patch)
tree85a9c2dca5a92f155ba27c1b284dba3d2581ce69 /net
parent52d3ef5c2537d1b892d5fefff754b995394d7be3 (diff)
Bluetooth: Fix updating SMP remote key distribution information
When performing pairing using SMP the remote may clear any key distribution bits it wants in its pairing response. We must therefore update our local variable accordingly, otherwise we might get stuck waiting for keys that will never come. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/smp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 74a17cf91b26..8a1b1bf79555 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -748,6 +748,11 @@ static u8 smp_cmd_pairing_rsp(struct l2cap_conn *conn, struct sk_buff *skb)
748 smp->prsp[0] = SMP_CMD_PAIRING_RSP; 748 smp->prsp[0] = SMP_CMD_PAIRING_RSP;
749 memcpy(&smp->prsp[1], rsp, sizeof(*rsp)); 749 memcpy(&smp->prsp[1], rsp, sizeof(*rsp));
750 750
751 /* Update remote key distribution in case the remote cleared
752 * some bits that we had enabled in our request.
753 */
754 smp->remote_key_dist &= rsp->resp_key_dist;
755
751 if ((req->auth_req & SMP_AUTH_BONDING) && 756 if ((req->auth_req & SMP_AUTH_BONDING) &&
752 (rsp->auth_req & SMP_AUTH_BONDING)) 757 (rsp->auth_req & SMP_AUTH_BONDING))
753 auth = SMP_AUTH_BONDING; 758 auth = SMP_AUTH_BONDING;