]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Bluetooth: hci_sync: Fix not updating privacy_mode
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 14 Jul 2022 00:12:14 +0000 (17:12 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:41:11 +0000 (14:41 +0200)
[ Upstream commit 0900b1c62f43e495d04ca4bebdf80b34f3c12432 ]

When programming a new entry into the resolving list it shall default
to network mode since the params may contain the mode programmed when
the device was last added to the resolving list.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=209745
Fixes: 853b70b506a20 ("Bluetooth: hci_sync: Set Privacy Mode when updating the resolving list")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tested-by: Zhengping Jiang <jiangzp@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/bluetooth/hci_sync.c

index 99ef15167a81ec096c13bf221dad8e6cb909756c..6f901398132e3c7d7366ccc5e34634be3f4dfc47 100644 (file)
@@ -1612,6 +1612,9 @@ static int hci_le_add_resolve_list_sync(struct hci_dev *hdev,
        bacpy(&cp.bdaddr, &params->addr);
        memcpy(cp.peer_irk, irk->val, 16);
 
+       /* Default privacy mode is always Network */
+       params->privacy_mode = HCI_NETWORK_PRIVACY;
+
 done:
        if (hci_dev_test_flag(hdev, HCI_PRIVACY))
                memcpy(cp.local_irk, hdev->irk, 16);