aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2013-10-03 00:31:52 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2013-10-03 02:20:37 -0400
commitcdba5281b2496ffbca332e006f258951233bf53d (patch)
treeb625297d11656e4df63031ab6a56f0bddbc21cae
parent3b1662952ea9c2c32aac11d60f824fb94b2cf546 (diff)
Bluetooth: Restrict SSP setting changes to BR/EDR enabled controllers
Only when BR/EDR is supported and enabled, allow changing of the SSP setting. Just checking if the hardware supports SSP is not enough since it might be the case that BR/EDR is disabled. In the case that BR/EDR is disabled, but SSP supported by the controller the not supported error message is now returned. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
-rw-r--r--net/bluetooth/mgmt.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 3b3ed0522fcf..b09c86b6996a 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -1296,11 +1296,15 @@ static int set_ssp(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)
1296{ 1296{
1297 struct mgmt_mode *cp = data; 1297 struct mgmt_mode *cp = data;
1298 struct pending_cmd *cmd; 1298 struct pending_cmd *cmd;
1299 u8 val; 1299 u8 val, status;
1300 int err; 1300 int err;
1301 1301
1302 BT_DBG("request for %s", hdev->name); 1302 BT_DBG("request for %s", hdev->name);
1303 1303
1304 status = mgmt_bredr_support(hdev);
1305 if (status)
1306 return cmd_status(sk, hdev->id, MGMT_OP_SET_SSP, status);
1307
1304 if (!lmp_ssp_capable(hdev)) 1308 if (!lmp_ssp_capable(hdev))
1305 return cmd_status(sk, hdev->id, MGMT_OP_SET_SSP, 1309 return cmd_status(sk, hdev->id, MGMT_OP_SET_SSP,
1306 MGMT_STATUS_NOT_SUPPORTED); 1310 MGMT_STATUS_NOT_SUPPORTED);