diff mbox series

[BlueZ] adapter: Fix advertising monitor on Linux 5.12-5.17

Message ID 20220630073958.34468-1-adrake@adrake.org
State New
Headers show
Series [BlueZ] adapter: Fix advertising monitor on Linux 5.12-5.17 | expand

Commit Message

Andrew Drake June 30, 2022, 7:39 a.m. UTC
The existing code assumes that, if a device supports advertising monitor
offload, DEVICE_FOUND events can be ignored since the kernel will send
ADV_MONITOR_DEVICE_FOUND events instead. Unfortunately, these new events
were added in 5.18, but offload was added in 5.12. This patch adds a
check on the MGMT API version so we can process the older DEVICE_FOUND
events when the new events are not supported.

Fixes: https://github.com/bluez/bluez/issues/357
---
 src/adapter.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

patchwork-bot+bluetooth@kernel.org July 13, 2022, 9:30 p.m. UTC | #1
Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Thu, 30 Jun 2022 00:39:58 -0700 you wrote:
> The existing code assumes that, if a device supports advertising monitor
> offload, DEVICE_FOUND events can be ignored since the kernel will send
> ADV_MONITOR_DEVICE_FOUND events instead. Unfortunately, these new events
> were added in 5.18, but offload was added in 5.12. This patch adds a
> check on the MGMT API version so we can process the older DEVICE_FOUND
> events when the new events are not supported.
> 
> [...]

Here is the summary with links:
  - [BlueZ] adapter: Fix advertising monitor on Linux 5.12-5.17
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=a69fa692b094

You are awesome, thank you!
diff mbox series

Patch

diff --git a/src/adapter.c b/src/adapter.c
index 16da20034..62ca42ffb 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -6909,7 +6909,9 @@  void btd_adapter_update_found_device(struct btd_adapter *adapter,
 	bool duplicate = false;
 	struct queue *matched_monitors = NULL;
 
-	if (!btd_adv_monitor_offload_enabled(adapter->adv_monitor_manager)) {
+	if (!btd_adv_monitor_offload_enabled(adapter->adv_monitor_manager) ||
+				(MGMT_VERSION(mgmt_version, mgmt_revision) <
+							MGMT_VERSION(1, 22))) {
 		if (bdaddr_type != BDADDR_BREDR)
 			ad = bt_ad_new_with_data(data_len, data);