diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2013-11-05 04:30:39 -0500 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2013-11-13 08:36:54 -0500 |
commit | 86ca9eac31d0d8c4fe61b5726e6d63197bc435a6 (patch) | |
tree | bc2df6ca01075b06286179629a41a28c9884701c /net/bluetooth | |
parent | 31e8ce80baa7eaed9eec611deba982b24beed9e5 (diff) |
Bluetooth: Fix rejecting SMP security request in slave role
The SMP security request is for a slave role device to request the
master role device to initiate a pairing request. If we receive this
command while we're in the slave role we should reject it appropriately.
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.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index b5562abdd6e0..ccad6c1e3ec3 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c | |||
@@ -739,6 +739,9 @@ static u8 smp_cmd_security_req(struct l2cap_conn *conn, struct sk_buff *skb) | |||
739 | 739 | ||
740 | BT_DBG("conn %p", conn); | 740 | BT_DBG("conn %p", conn); |
741 | 741 | ||
742 | if (!(conn->hcon->link_mode & HCI_LM_MASTER)) | ||
743 | return SMP_CMD_NOTSUPP; | ||
744 | |||
742 | hcon->pending_sec_level = authreq_to_seclevel(rp->auth_req); | 745 | hcon->pending_sec_level = authreq_to_seclevel(rp->auth_req); |
743 | 746 | ||
744 | if (smp_ltk_encrypt(conn, hcon->pending_sec_level)) | 747 | if (smp_ltk_encrypt(conn, hcon->pending_sec_level)) |