summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/mgmt.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2015-01-22 14:15:22 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2015-01-22 14:44:20 -0500
commited93ec69c7e0e80d733dced5b73af0f23cc3b061 (patch)
tree492efc044ec516438d9be699af0000e7f3314b45 /net/bluetooth/mgmt.c
parent3a5486e1fdb0da7a18788f40b17d351af90d0ea7 (diff)
Bluetooth: Require SSP enabling before BR/EDR Secure Connections
When BR/EDR is supported by a controller, then it is required to enable Secure Simple Pairing first before enabling the Secure Connections feature. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r--net/bluetooth/mgmt.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index e86b8d9105e9..41e30055bae8 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -4758,6 +4758,11 @@ static int set_secure_conn(struct sock *sk, struct hci_dev *hdev,
4758 return cmd_status(sk, hdev->id, MGMT_OP_SET_SECURE_CONN, 4758 return cmd_status(sk, hdev->id, MGMT_OP_SET_SECURE_CONN,
4759 MGMT_STATUS_NOT_SUPPORTED); 4759 MGMT_STATUS_NOT_SUPPORTED);
4760 4760
4761 if (test_bit(HCI_BREDR_ENABLED, &hdev->dev_flags) &&
4762 !test_bit(HCI_SSP_ENABLED, &hdev->dev_flags))
4763 return cmd_status(sk, hdev->id, MGMT_OP_SET_SECURE_CONN,
4764 MGMT_STATUS_REJECTED);
4765
4761 if (cp->val != 0x00 && cp->val != 0x01 && cp->val != 0x02) 4766 if (cp->val != 0x00 && cp->val != 0x01 && cp->val != 0x02)
4762 return cmd_status(sk, hdev->id, MGMT_OP_SET_SECURE_CONN, 4767 return cmd_status(sk, hdev->id, MGMT_OP_SET_SECURE_CONN,
4763 MGMT_STATUS_INVALID_PARAMS); 4768 MGMT_STATUS_INVALID_PARAMS);