From: Andrew Drake <adrake@adrake.org>
To: linux-bluetooth@vger.kernel.org
Cc: Andrew Drake <adrake@adrake.org>
Subject: [PATCH BlueZ] adapter: Fix advertising monitor on Linux 5.12-5.17
Date: Thu, 30 Jun 2022 00:39:58 -0700 [thread overview]
Message-ID: <20220630073958.34468-1-adrake@adrake.org> (raw)
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(-)
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);
--
2.35.3
next reply other threads:[~2022-06-30 7:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-30 7:39 Andrew Drake [this message]
2022-06-30 9:37 ` [BlueZ] adapter: Fix advertising monitor on Linux 5.12-5.17 bluez.test.bot
2022-07-13 21:30 ` [PATCH BlueZ] " patchwork-bot+bluetooth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220630073958.34468-1-adrake@adrake.org \
--to=adrake@adrake.org \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.