diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2016-03-11 10:56:32 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2016-03-11 18:28:24 +0300 |
commit | 6a19cc8c892b113fb84947207346f783de76dbd1 (patch) | |
tree | 49542daade5c3e5c40e1c436c4f6e07ba1674e2a /net/bluetooth/hci_request.c | |
parent | 9c176cec42e4b0deeed901fc363bf4235c5ca96a (diff) | |
download | linux-6a19cc8c892b113fb84947207346f783de76dbd1.tar.xz |
Bluetooth: Fix setting correct flags in AD
A recent change added MGMT_ADV_FLAG_DISCOV to the flags returned by
get_adv_instance_flags(), however failed to take into account limited
discoverable mode. This patch fixes the issue by setting the correct
discoverability flag in the AD data.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_request.c')
-rw-r--r-- | net/bluetooth/hci_request.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c index 95a545ca9dbc..6e125d76df0d 100644 --- a/net/bluetooth/hci_request.c +++ b/net/bluetooth/hci_request.c @@ -872,7 +872,9 @@ static u32 get_adv_instance_flags(struct hci_dev *hdev, u8 instance) if (hci_dev_test_flag(hdev, HCI_ADVERTISING_CONNECTABLE)) flags |= MGMT_ADV_FLAG_CONNECTABLE; - if (hci_dev_test_flag(hdev, HCI_DISCOVERABLE)) + if (hci_dev_test_flag(hdev, HCI_LIMITED_DISCOVERABLE)) + flags |= MGMT_ADV_FLAG_LIMITED_DISCOV; + else if (hci_dev_test_flag(hdev, HCI_DISCOVERABLE)) flags |= MGMT_ADV_FLAG_DISCOV; return flags; |