linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ] btdev: Fix not checking if a CIG has any active CIS
@ 2022-07-08  0:27 Luiz Augusto von Dentz
  2022-07-08  3:01 ` [BlueZ] " bluez.test.bot
  2022-07-11 16:40 ` [PATCH BlueZ] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2022-07-08  0:27 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

Bluetooth Core specification says the CIG must be in configurable state
in order to accept the SetCIGParameters:

BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 4, Part E page 2553:

 'If the Host issues this command when the CIG is not in the
  configurable state, the Controller shall return the error
  code Command Disallowed (0x0C).'
---
 emulator/btdev.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/emulator/btdev.c b/emulator/btdev.c
index 641e308b3..3fdfb64a9 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -5831,8 +5831,25 @@ static int cmd_set_cig_params(struct btdev *dev, const void *data,
 	rsp.params.cig_id = cmd->cig_id;
 
 	for (i = 0; i < cmd->num_cis; i++) {
+		struct btdev_conn *iso;
+
 		rsp.params.num_handles++;
 		rsp.handle[i] = cpu_to_le16(ISO_HANDLE + i);
+
+		/* BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 4, Part E
+		 * page 2553
+		 *
+		 * If the Host issues this command when the CIG is not in the
+		 * configurable state, the Controller shall return the error
+		 * code Command Disallowed (0x0C).
+		 */
+		iso = queue_find(dev->conns, match_handle,
+				UINT_TO_PTR(cpu_to_le16(rsp.handle[i])));
+		if (iso) {
+			rsp.params.status = BT_HCI_ERR_INVALID_PARAMETERS;
+			i = 0;
+			goto done;
+		}
 	}
 
 done:
-- 
2.35.3


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

* RE: [BlueZ] btdev: Fix not checking if a CIG has any active CIS
  2022-07-08  0:27 [PATCH BlueZ] btdev: Fix not checking if a CIG has any active CIS Luiz Augusto von Dentz
@ 2022-07-08  3:01 ` bluez.test.bot
  2022-07-11 16:40 ` [PATCH BlueZ] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2022-07-08  3:01 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

[-- Attachment #1: Type: text/plain, Size: 1047 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=657632

---Test result---

Test Summary:
CheckPatch                    PASS      0.77 seconds
GitLint                       PASS      0.55 seconds
Prep - Setup ELL              PASS      26.20 seconds
Build - Prep                  PASS      0.57 seconds
Build - Configure             PASS      8.09 seconds
Build - Make                  PASS      724.77 seconds
Make Check                    PASS      11.08 seconds
Make Check w/Valgrind         PASS      281.28 seconds
Make Distcheck                PASS      231.89 seconds
Build w/ext ELL - Configure   PASS      8.09 seconds
Build w/ext ELL - Make        PASS      79.95 seconds
Incremental Build w/ patches  PASS      0.00 seconds
Scan Build                    PASS      472.76 seconds



---
Regards,
Linux Bluetooth


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

* Re: [PATCH BlueZ] btdev: Fix not checking if a CIG has any active CIS
  2022-07-08  0:27 [PATCH BlueZ] btdev: Fix not checking if a CIG has any active CIS Luiz Augusto von Dentz
  2022-07-08  3:01 ` [BlueZ] " bluez.test.bot
@ 2022-07-11 16:40 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2022-07-11 16:40 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Thu,  7 Jul 2022 17:27:51 -0700 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> Bluetooth Core specification says the CIG must be in configurable state
> in order to accept the SetCIGParameters:
> 
> BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 4, Part E page 2553:
> 
> [...]

Here is the summary with links:
  - [BlueZ] btdev: Fix not checking if a CIG has any active CIS
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=163de8e231e6

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2022-07-11 16:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-08  0:27 [PATCH BlueZ] btdev: Fix not checking if a CIG has any active CIS Luiz Augusto von Dentz
2022-07-08  3:01 ` [BlueZ] " bluez.test.bot
2022-07-11 16:40 ` [PATCH BlueZ] " patchwork-bot+bluetooth

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