diff options
author | Andrew Drake <adrake@adrake.org> | 2022-06-30 00:39:58 -0700 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-07-13 14:27:32 -0700 |
commit | a69fa692b094347e3a1dbcd9198d426f671dec0c (patch) | |
tree | 360f941f485b7dccd777c11dc80b1cf2c9540638 /src/adapter.c | |
parent | 163de8e231e6e138ebfea710df8211f22d4b9b4e (diff) | |
download | bluez-a69fa692b094347e3a1dbcd9198d426f671dec0c.tar.gz |
adapter: Fix advertising monitor on Linux 5.12-5.17
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
Diffstat (limited to 'src/adapter.c')
-rw-r--r-- | src/adapter.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/adapter.c b/src/adapter.c index c4d5ad2e2..6e33281c1 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -6907,7 +6907,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); |