]> git.karo-electronics.de Git - linux-beck.git/blobdiff - net/bluetooth/smp.c
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetoot...
[linux-beck.git] / net / bluetooth / smp.c
index fc200e06aa04b0b682aa35edf5de1e93ce36b4cd..4b07acb8293c3df3542e2a1661a6ae07bcfa6596 100644 (file)
@@ -742,6 +742,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))
@@ -864,7 +867,7 @@ int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb)
                return -EILSEQ;
        }
 
-       if (!test_bit(HCI_LE_ENABLED, &conn->hcon->hdev->dev_flags)) {
+       if (!test_bit(HCI_LE_ENABLED, &hcon->hdev->dev_flags)) {
                err = -ENOTSUPP;
                reason = SMP_PAIRING_NOTSUPP;
                goto done;