* [PATCH BlueZ v2] adapter: Fix discovery filter RSSI and Pathloss matching
@ 2026-11-23 16:22 Simon Mikuda
2026-11-24 1:36 ` [BlueZ,v2] " bluez.test.bot
0 siblings, 1 reply; 2+ messages in thread
From: Simon Mikuda @ 2026-11-23 16:22 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Simon Mikuda
is_filter_match() takes a device as close enough if the RSSI threshold
is unset or met, or if the Pathloss threshold is unset or met. Since a
filter cannot set both, the one left unset lets every device through.
The Pathloss threshold, which the kernel cannot apply, is then never
applied at all, and an RSSI threshold only as far as the kernel filter
goes, which holds the lowest threshold of all clients.
To reproduce, discover a device with an RSSI of -60 dBm and a TX power
of 0 dBm, so a path loss of 60 dB, with a Pathloss filter of 59:
[bluetooth]# scan.transport bredr
[bluetooth]# scan.pathloss 59
[bluetooth]# scan on
The device is reported anyway:
parse_discovery_filter_dict() filtered discovery params:
transport: 1 rssi: 32767 pathloss: 59 ...
device_found_callback() hci0 addr 00:AA:01:01:00:42, rssi -60 ...
device_set_rssi_with_delta() rssi -60
device_set_tx_power() tx_power 0
Require each threshold that is set to be met. An RSSI of 127 means it
is not available, so a device reported with it meets neither threshold;
before, it met any RSSI threshold and, as a path loss of tx_power - 127,
any Pathloss threshold.
Fixes: ebcb6aa7c527 ("core/adapter: Filter discovery results")
Assisted-by: Claude:claude-opus-5-5
---
src/adapter.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/adapter.c b/src/adapter.c
index 1439642cb..f56e84324 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -7610,11 +7610,13 @@ static bool is_filter_match(GSList *discovery_filter, struct eir_data *eir_data,
if (got_match) {
/* we have service match, check proximity */
- if (item->rssi == DISTANCE_VAL_INVALID ||
- item->rssi <= rssi ||
- item->pathloss == DISTANCE_VAL_INVALID ||
- (eir_data->tx_power != 127 &&
- eir_data->tx_power - rssi <= item->pathloss))
+ if ((item->rssi == DISTANCE_VAL_INVALID ||
+ (rssi != HCI_RSSI_INVALID &&
+ item->rssi <= rssi)) &&
+ (item->pathloss == DISTANCE_VAL_INVALID ||
+ (rssi != HCI_RSSI_INVALID &&
+ eir_data->tx_power != 127 &&
+ eir_data->tx_power - rssi <= item->pathloss)))
return true;
got_match = false;
base-commit: 1adfe662efeff12997df9ddd0960dbd0de9c8ea7
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [BlueZ,v2] adapter: Fix discovery filter RSSI and Pathloss matching
2026-11-23 16:22 [PATCH BlueZ v2] adapter: Fix discovery filter RSSI and Pathloss matching Simon Mikuda
@ 2026-11-24 1:36 ` bluez.test.bot
0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2026-11-24 1:36 UTC (permalink / raw)
To: linux-bluetooth, simon.mikuda
[-- Attachment #1: Type: text/plain, Size: 1096 bytes --]
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/series/1219836/
---Test result---
Test Summary:
CheckPatch PASS 0.21 seconds
GitLint PASS 0.15 seconds
BuildEll PASS 13.25 seconds
BluezMake PASS 201.94 seconds
CheckSmatch PASS 182.15 seconds
bluezmakeextell PASS 65.55 seconds
TestFunctional FAIL 962.14 seconds
IncrementalBuild PASS 202.53 seconds
ScanBuild PASS 694.65 seconds
Details
##############################
Test: TestFunctional - FAIL
Desc: Run test-functional
Output:
FAIL functional.test_bap::test_bass_past_earbuds_transport_acquire[hosts11-vm3]: AssertionError: Failed to acquire: org.bluez.Error.Failed
https://github.com/bluez/bluez/pull/2885
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-24 1:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 16:22 [PATCH BlueZ v2] adapter: Fix discovery filter RSSI and Pathloss matching Simon Mikuda
2026-11-24 1:36 ` [BlueZ,v2] " bluez.test.bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox