Skip to content

Commit 5a04429

Browse files
Vudentzgregkh
authored andcommitted
Bluetooth: hci_core: Fix using ll_privacy_capable for current settings
[ Upstream commit 3dcf717 ] ll_privacy_capable only indicates that the controller supports the feature but it doesnt' check that LE is enabled so it end up being marked as active in the current settings when it shouldn't. Fixes: ad383c2 ("Bluetooth: hci_sync: Enable advertising when LL privacy is enabled") Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 5c472a3 commit 5a04429

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

include/net/bluetooth/hci_core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1951,6 +1951,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
19511951
((dev)->le_rx_def_phys & HCI_LE_SET_PHY_CODED))
19521952

19531953
#define ll_privacy_capable(dev) ((dev)->le_features[0] & HCI_LE_LL_PRIVACY)
1954+
#define ll_privacy_enabled(dev) (le_enabled(dev) && ll_privacy_capable(dev))
19541955

19551956
#define privacy_mode_capable(dev) (ll_privacy_capable(dev) && \
19561957
((dev)->commands[39] & 0x04))

net/bluetooth/mgmt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ static u32 get_current_settings(struct hci_dev *hdev)
934934
if (sync_recv_enabled(hdev))
935935
settings |= MGMT_SETTING_ISO_SYNC_RECEIVER;
936936

937-
if (ll_privacy_capable(hdev))
937+
if (ll_privacy_enabled(hdev))
938938
settings |= MGMT_SETTING_LL_PRIVACY;
939939

940940
return settings;

0 commit comments

Comments
 (0)