Skip to content

Commit 3dcf717

Browse files
committed
Bluetooth: hci_core: Fix using ll_privacy_capable for current settings
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 <[email protected]>
1 parent 709788b commit 3dcf717

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
@@ -1934,6 +1934,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
19341934
((dev)->le_rx_def_phys & HCI_LE_SET_PHY_CODED))
19351935

19361936
#define ll_privacy_capable(dev) ((dev)->le_features[0] & HCI_LE_LL_PRIVACY)
1937+
#define ll_privacy_enabled(dev) (le_enabled(dev) && ll_privacy_capable(dev))
19371938

19381939
#define privacy_mode_capable(dev) (ll_privacy_capable(dev) && \
19391940
((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)