Skip to contentSkip to conversation

Bluetooth: hci_sync: Fix not updating privacy_mode

PATCH Superseded Luiz Augusto von Dentz 2 participants 3 messages Jul 14, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
author maintainer
#1 lore raw

PATCH 2/2 Bluetooth: hci_sync: Don't remove connected devices from accept list

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

These devices are likely going to be reprogrammed when disconnected so this avoid a whole bunch of commands attempt to remove and the add back to the list.

---
 net/bluetooth/hci_sync.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
net/bluetooth/hci_sync.c +5 -2
index 9f44537db348..86846a765be0 100644
@@ -1892,12 +1892,15 @@ static u8 hci_update_accept_list_sync(struct hci_dev *hdev)
 	}
 
 	/* Go through the current accept list programmed into the
-	 * controller one by one and check if that address is still
-	 * in the list of pending connections or list of devices to
+	 * controller one by one and check if that address is connected or is
+	 * still in the list of pending connections or list of devices to
 	 * report. If not present in either list, then remove it from
 	 * the controller.
 	 */
 	list_for_each_entry_safe(b, t, &hdev->le_accept_list, list) {
+		if (hci_conn_hash_lookup_le(hdev, &b->bdaddr, b->bdaddr_type))
+			continue;
+
 		pend_conn = hci_pend_le_action_lookup(&hdev->pend_le_conns,
 						      &b->bdaddr,
 						      b->bdaddr_type);
Signature · 1 line
2.35.3

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/2 Bluetooth: hci_sync: Fix not updating privacy_mode

From: Luiz Augusto von Dentz <[email protected]>

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.

---
 net/bluetooth/hci_sync.c | 3 +++
 1 file changed, 3 insertions(+)
net/bluetooth/hci_sync.c +3 -0
index ca97378fd81f..9f44537db348 100644
@@ -1636,6 +1636,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 0x00 (Network) */
+	params->privacy_mode = 0x00;
+
 done:
 	if (hci_dev_test_flag(hdev, HCI_PRIVACY))
 		memcpy(cp.local_irk, hdev->irk, 16);
Signature · 1 line
2.35.3
#2 lore raw

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=659501

---Test result---

Test Summary:

CheckPatch                    PASS      1.81 seconds
GitLint                       PASS      0.86 seconds
SubjectPrefix                 PASS      0.57 seconds
BuildKernel                   PASS      38.36 seconds
BuildKernel32                 PASS      33.29 seconds
Incremental Build with patchesPASS      52.35 seconds
TestRunner: Setup             PASS      567.70 seconds
TestRunner: l2cap-tester      PASS      18.89 seconds
TestRunner: bnep-tester       PASS      6.72 seconds
TestRunner: mgmt-tester       PASS      111.46 seconds
TestRunner: rfcomm-tester     PASS      10.33 seconds
TestRunner: sco-tester        PASS      10.27 seconds
TestRunner: smp-tester        PASS      10.16 seconds
TestRunner: userchan-tester   PASS      7.16 seconds

---
Regards,
Linux Bluetooth