diff mbox series

[BlueZ,1/1] adapter: Fix unnecessarily enabling the connectable property.

Message ID 20250214224149.135458-2-vibhavp@gmail.com
State New
Headers show
Series adapter: Fix unnecessarily enabling the connectable property. | expand

Commit Message

Vibhav Pant Feb. 14, 2025, 10:41 p.m. UTC
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(-)

Comments

bluez.test.bot@gmail.com Feb. 15, 2025, 12:09 a.m. UTC | #1
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
diff mbox series

Patch

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);