2021-03-07 09:20:26

by Kiran K

[permalink] [raw]
Subject: [PATCH v1] monitor: Fix decoding Read Local Supported Codec Capabilities

Codec capabilities wern't properly decoded due to wrong offset

< HCI Command: Read Local Supported Codec Capabilities (0x04|0x000e) plen 7
Codec: A-law log (0x01)
Logical Transport Type: 0x01
Codec supported over BR/EDR ACL
Direction: Input (Host to Controller) (0x00)
> HCI Event: Command Complete (0x0e) plen 18
Read Local Supported Codec Capabilities (0x04|0x000e) ncmd 1
Status: Success (0x00)
Number of codec capabilities: 3
Capabilities #0:
aa bb cc dd ....
Capabilities #1:
11 22 33 44 55 ."3DU
Capabilities #2:
ff .
---
monitor/packet.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/monitor/packet.c b/monitor/packet.c
index fb265028c213..75b61d57aa7c 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -6032,23 +6032,23 @@ static void read_local_codec_caps_rsp(const void *data, uint8_t size)
print_status(rsp->status);
print_field("Number of codec capabilities: %d", rsp->num);

- data += sizeof(rsp);
- size -= sizeof(rsp);
+ data += sizeof(*rsp);
+ size -= sizeof(*rsp);

for (i = 0; i < rsp->num; i++) {
const struct bt_hci_codec_caps *caps = data;

- if (size < sizeof(caps)) {
+ if (size < sizeof(*caps)) {
print_field("Invalid capabilities: %u < %zu",
- size, sizeof(caps));
+ size, sizeof(*caps));
return;
}

print_field(" Capabilities #%u:", i);
packet_hexdump(caps->data, caps->len);

- data += caps->len;
- size -= caps->len;
+ data += 1 + caps->len;
+ size -= 1 + caps->len;
}
}

--
2.17.1


2021-03-07 09:39:50

by bluez.test.bot

[permalink] [raw]
Subject: RE: [v1] monitor: Fix decoding Read Local Supported Codec Capabilities

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=443331

---Test result---

##############################
Test: CheckPatch - PASS

##############################
Test: CheckGitLint - PASS

##############################
Test: CheckBuild - PASS

##############################
Test: MakeCheck - PASS



---
Regards,
Linux Bluetooth

2021-03-15 22:07:09

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [v1] monitor: Fix decoding Read Local Supported Codec Capabilities

Hi Kiran,

On Sun, Mar 7, 2021 at 1:39 AM <[email protected]> wrote:
>
> 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=443331
>
> ---Test result---
>
> ##############################
> Test: CheckPatch - PASS
>
> ##############################
> Test: CheckGitLint - PASS
>
> ##############################
> Test: CheckBuild - PASS
>
> ##############################
> Test: MakeCheck - PASS
>
>
>
> ---
> Regards,
> Linux Bluetooth

Applied, thanks.

--
Luiz Augusto von Dentz