From: Johan Hedberg Date: Tue, 5 Nov 2013 09:30:39 +0000 (+0200) Subject: Bluetooth: Fix rejecting SMP security request in slave role X-Git-Tag: accepted/tizen/common/20141203.182822~1043^2~6^2^2~12^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=86ca9eac31d0d8c4fe61b5726e6d63197bc435a6;p=platform%2Fkernel%2Flinux-arm64.git 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 Signed-off-by: Marcel Holtmann --- diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index b5562ab..ccad6c1 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) BT_DBG("conn %p", conn); + if (!(conn->hcon->link_mode & HCI_LM_MASTER)) + return SMP_CMD_NOTSUPP; + hcon->pending_sec_level = authreq_to_seclevel(rp->auth_req); if (smp_ltk_encrypt(conn, hcon->pending_sec_level))