diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2015-01-14 17:40:42 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2015-01-15 03:27:47 -0500 |
commit | 111e4bccd1e27f0703936aadf41f227a9226e031 (patch) | |
tree | 3f3c6c441bb176fcc1115cb3dab3094f249c36e2 /net/bluetooth | |
parent | eeb5a067d11e69fd235a36e17ff16a3177d847a4 (diff) |
Bluetooth: Fix issue with switching BR/EDR back on when disabled
For dual-mode controllers it is possible to disable BR/EDR and operate
as LE single mode controllers with a static random address. If that is
the case, then refuse switching BR/EDR back on after the controller has
been powered.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/mgmt.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index e531da805923..cae612658ba9 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -4683,6 +4683,21 @@ static int set_bredr(struct sock *sk, struct hci_dev *hdev, void *data, u16 len) | |||
4683 | err = cmd_status(sk, hdev->id, MGMT_OP_SET_BREDR, | 4683 | err = cmd_status(sk, hdev->id, MGMT_OP_SET_BREDR, |
4684 | MGMT_STATUS_REJECTED); | 4684 | MGMT_STATUS_REJECTED); |
4685 | goto unlock; | 4685 | goto unlock; |
4686 | } else { | ||
4687 | /* When configuring a dual-mode controller to operate | ||
4688 | * with LE only and using a static address, then switching | ||
4689 | * BR/EDR back on is not allowed. | ||
4690 | * | ||
4691 | * Dual-mode controllers shall operate with the public | ||
4692 | * address as its identity address for BR/EDR and LE. So | ||
4693 | * reject the attempt to create an invalid configuration. | ||
4694 | */ | ||
4695 | if (!test_bit(HCI_BREDR_ENABLED, &hdev->dev_flags) && | ||
4696 | bacmp(&hdev->static_addr, BDADDR_ANY)) { | ||
4697 | err = cmd_status(sk, hdev->id, MGMT_OP_SET_BREDR, | ||
4698 | MGMT_STATUS_REJECTED); | ||
4699 | goto unlock; | ||
4700 | } | ||
4686 | } | 4701 | } |
4687 | 4702 | ||
4688 | if (mgmt_pending_find(MGMT_OP_SET_BREDR, hdev)) { | 4703 | if (mgmt_pending_find(MGMT_OP_SET_BREDR, hdev)) { |