diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-12-24 13:43:11 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-12-24 14:02:00 -0500 |
commit | 6a8fc95c87110a466ee81675b41170b963f82bdb (patch) | |
tree | 23ba344cfd0ea811c8423c67ac77d46f28c9fdee /net | |
parent | 8bfe8442ff20fdc2d965c197103d935a99bd3296 (diff) |
Bluetooth: Fix accepting connections when not using mgmt
When connectable mode is enabled (page scan on) through some non-mgmt
method the HCI_CONNECTABLE flag will not be set. For backwards
compatibility with user space versions not using mgmt we should not
require HCI_CONNECTABLE to be set if HCI_MGMT is not set.
Reported-by: Pali Rohár <pali.rohar@gmail.com>
Tested-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Cc: stable@vger.kernel.org # 3.17+
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/hci_event.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index c03d4b09caa3..3f2e8b830cbd 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -2197,7 +2197,12 @@ static void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb) | |||
2197 | return; | 2197 | return; |
2198 | } | 2198 | } |
2199 | 2199 | ||
2200 | if (!test_bit(HCI_CONNECTABLE, &hdev->dev_flags) && | 2200 | /* Require HCI_CONNECTABLE or a whitelist entry to accept the |
2201 | * connection. These features are only touched through mgmt so | ||
2202 | * only do the checks if HCI_MGMT is set. | ||
2203 | */ | ||
2204 | if (test_bit(HCI_MGMT, &hdev->dev_flags) && | ||
2205 | !test_bit(HCI_CONNECTABLE, &hdev->dev_flags) && | ||
2201 | !hci_bdaddr_list_lookup(&hdev->whitelist, &ev->bdaddr, | 2206 | !hci_bdaddr_list_lookup(&hdev->whitelist, &ev->bdaddr, |
2202 | BDADDR_BREDR)) { | 2207 | BDADDR_BREDR)) { |
2203 | hci_reject_conn(hdev, &ev->bdaddr); | 2208 | hci_reject_conn(hdev, &ev->bdaddr); |