All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 0/1] adapter: Fix unnecessarily enabling the connectable property.
@ 2025-02-14 22:41 Vibhav Pant
  2025-02-14 22:41 ` [PATCH BlueZ 1/1] " Vibhav Pant
  0 siblings, 1 reply; 3+ messages in thread
From: Vibhav Pant @ 2025-02-14 22:41 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Vibhav Pant

Hello,
As the Connectable and Discoverable properties for an adapter can now be set independently, this creates an issue where if Connectable is set to true before setting Discoverable to true as well, property_set_mode will still try to set connectability to true, resulting in any future attempts to set Connectable failing with org.bluez.Error.Busy, as the adapter's pending_setting bitmask (specifically, MGMT_SETTING_CONNECTABLE) never gets cleared.
This can be reproduced by the following commands:

busctl set-property org.bluez /org/bluez/hci0 org.bluez.Adapter1 Connectable b true
busctl set-property org.bluez /org/bluez/hci0 org.bluez.Adapter1 Discoverable b true
busctl set-property org.bluez /org/bluez/hci0 org.bluez.Adapter1 Connectable b false

This patch fixes property_set_mode to only set connectable while enabling discoverability if it is currently disabled for the adapter.

Thanks,
Vibhav

Vibhav Pant (1):
  adapter: Fix unnecessarily enabling the connectable property.

 src/adapter.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
2.48.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH BlueZ 1/1] adapter: Fix unnecessarily enabling the connectable property.
  2025-02-14 22:41 [PATCH BlueZ 0/1] adapter: Fix unnecessarily enabling the connectable property Vibhav Pant
@ 2025-02-14 22:41 ` Vibhav Pant
  2025-02-15  0:09   ` bluez.test.bot
  0 siblings, 1 reply; 3+ messages in thread
From: Vibhav Pant @ 2025-02-14 22:41 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Vibhav Pant

While enabling the discoverable property for an adapter, only enable
the connectable property only if it is currently disabled.
---
 src/adapter.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index da602a7b8..01ef0db5a 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -3142,10 +3142,11 @@ static void property_set_mode(struct btd_adapter *adapter, uint32_t setting,
 		break;
 	case MGMT_SETTING_DISCOVERABLE:
 		if (btd_has_kernel_features(KERNEL_CONN_CONTROL)) {
-			if (mode) {
+			if (mode && !(adapter->current_settings &
+				      MGMT_SETTING_CONNECTABLE)) {
 				set_mode(adapter, MGMT_OP_SET_CONNECTABLE,
 									mode);
-			} else {
+			} else if (!mode) {
 				opcode = MGMT_OP_SET_CONNECTABLE;
 				param = &mode;
 				len = sizeof(mode);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: adapter: Fix unnecessarily enabling the connectable property.
  2025-02-14 22:41 ` [PATCH BlueZ 1/1] " Vibhav Pant
@ 2025-02-15  0:09   ` bluez.test.bot
  0 siblings, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2025-02-15  0:09 UTC (permalink / raw)
  To: linux-bluetooth, vibhavp

[-- Attachment #1: Type: text/plain, Size: 1260 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/project/bluetooth/list/?series=934207

---Test result---

Test Summary:
CheckPatch                    PENDING   0.20 seconds
GitLint                       PENDING   0.20 seconds
BuildEll                      PASS      20.45 seconds
BluezMake                     PASS      1546.46 seconds
MakeCheck                     PASS      13.56 seconds
MakeDistcheck                 PASS      157.94 seconds
CheckValgrind                 PASS      214.45 seconds
CheckSmatch                   PASS      283.28 seconds
bluezmakeextell               PASS      97.91 seconds
IncrementalBuild              PENDING   0.27 seconds
ScanBuild                     PASS      855.36 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-02-15  0:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-14 22:41 [PATCH BlueZ 0/1] adapter: Fix unnecessarily enabling the connectable property Vibhav Pant
2025-02-14 22:41 ` [PATCH BlueZ 1/1] " Vibhav Pant
2025-02-15  0:09   ` bluez.test.bot

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.