From: "Per Waagø" <pwaago@cisco.com>
To: linux-bluetooth@vger.kernel.org
Cc: "Per Waagø" <pwaago@cisco.com>
Subject: [PATCH BlueZ] adapter: Enable SSP after enabling BREDR
Date: Wed, 29 Nov 2023 11:16:27 +0100 [thread overview]
Message-ID: <20231129101627.1742015-1-pwaago@cisco.com> (raw)
When enabling Secure Simple Pairing, the kernel first checks if
BREDR is enabled. If it's not, enabling SSP fails. Therefore, it
is necessary to make sure that BREDR is enabled before enabling
SSP.
Without this fix, bluetoothd would start without SSP enabled if
started in dual or bredr mode after it had been run in le mode.
---
src/adapter.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/adapter.c b/src/adapter.c
index 2c3cf7600..86fff72bc 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -10229,12 +10229,12 @@ static void read_info_complete(uint8_t status, uint16_t length,
switch (btd_opts.mode) {
case BT_MODE_DUAL:
- if (missing_settings & MGMT_SETTING_SSP)
- set_mode(adapter, MGMT_OP_SET_SSP, 0x01);
if (missing_settings & MGMT_SETTING_LE)
set_mode(adapter, MGMT_OP_SET_LE, 0x01);
if (missing_settings & MGMT_SETTING_BREDR)
set_mode(adapter, MGMT_OP_SET_BREDR, 0x01);
+ if (missing_settings & MGMT_SETTING_SSP)
+ set_mode(adapter, MGMT_OP_SET_SSP, 0x01);
break;
case BT_MODE_BREDR:
if (!(adapter->supported_settings & MGMT_SETTING_BREDR)) {
@@ -10243,10 +10243,10 @@ static void read_info_complete(uint8_t status, uint16_t length,
goto failed;
}
- if (missing_settings & MGMT_SETTING_SSP)
- set_mode(adapter, MGMT_OP_SET_SSP, 0x01);
if (missing_settings & MGMT_SETTING_BREDR)
set_mode(adapter, MGMT_OP_SET_BREDR, 0x01);
+ if (missing_settings & MGMT_SETTING_SSP)
+ set_mode(adapter, MGMT_OP_SET_SSP, 0x01);
if (adapter->current_settings & MGMT_SETTING_LE)
set_mode(adapter, MGMT_OP_SET_LE, 0x00);
break;
--
2.42.1
next reply other threads:[~2023-11-29 10:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-29 10:16 Per Waagø [this message]
2023-11-29 11:25 ` [BlueZ] adapter: Enable SSP after enabling BREDR bluez.test.bot
2023-12-05 3:40 ` [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=20231129101627.1742015-1-pwaago@cisco.com \
--to=pwaago@cisco.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).