2023-03-23 10:33:23

by Simon Mikuda

[permalink] [raw]
Subject: [PATCH BlueZ 0/2] monitor

Hello!

I'm sending some fixes to btmon.

Best regards.

Simon Mikuda (2):
monitor: Fix crash when there is no write handler
monitor: Fix printing Signed Write Command

monitor/att.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

--
2.34.1


2023-03-23 10:36:46

by Simon Mikuda

[permalink] [raw]
Subject: [PATCH BlueZ 1/2] monitor: Fix crash when there is no write handler

---
monitor/att.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/monitor/att.c b/monitor/att.c
index f9643b333..d3b82074f 100644
--- a/monitor/att.c
+++ b/monitor/att.c
@@ -2946,7 +2946,7 @@ static void print_write(const struct l2cap_frame *frame, uint16_t handle,
return;

handler = get_handler(attr);
- if (!handler)
+ if (!handler || !handler->write)
return;

handler->write(frame);
--
2.34.1

2023-03-23 10:41:11

by Simon Mikuda

[permalink] [raw]
Subject: [PATCH BlueZ 2/2] monitor: Fix printing Signed Write Command

Data field were print twice (1 time incorrectly):
> ACL Data RX: Handle 64 flags 0x02 dlen 19
ATT: Signed Write Command (0xd2) len 14
Handle: 0x006f Type: Vendor specific (f7debc9a-7856-3412-7856-341278563412)
Data: 0800000087f303c224516133
Data:
Signature: 0800000087f303c224516133
---
monitor/att.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/monitor/att.c b/monitor/att.c
index d3b82074f..18a5af05b 100644
--- a/monitor/att.c
+++ b/monitor/att.c
@@ -2934,13 +2934,14 @@ static void print_write(const struct l2cap_frame *frame, uint16_t handle,
struct gatt_handler *handler;

print_handle(frame, handle, false);
- print_hex_field(" Data", frame->data, frame->size);

if (len > frame->size) {
print_text(COLOR_ERROR, "invalid size");
return;
}

+ print_hex_field(" Data", frame->data, len);
+
attr = get_attribute(frame, handle, false);
if (!attr)
return;
@@ -3105,7 +3106,6 @@ static void att_signed_write_command(const struct l2cap_frame *frame)
}

print_write(frame, handle, frame->size - 12);
- print_hex_field(" Data", frame->data, frame->size - 12);
print_hex_field(" Signature", frame->data + frame->size - 12, 12);
}

--
2.34.1

2023-03-23 11:49:22

by bluez.test.bot

[permalink] [raw]
Subject: RE: monitor

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

---Test result---

Test Summary:
CheckPatch FAIL 1.28 seconds
GitLint FAIL 0.96 seconds
BuildEll PASS 27.11 seconds
BluezMake PASS 867.28 seconds
MakeCheck PASS 11.16 seconds
MakeDistcheck PASS 150.36 seconds
CheckValgrind PASS 245.68 seconds
CheckSmatch WARNING 328.41 seconds
bluezmakeextell PASS 98.55 seconds
IncrementalBuild PASS 1441.30 seconds
ScanBuild PASS 1013.20 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[BlueZ,2/2] monitor: Fix printing Signed Write Command
WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#81:
Handle: 0x006f Type: Vendor specific (f7debc9a-7856-3412-7856-341278563412)

/github/workspace/src/src/13185462.patch total: 0 errors, 1 warnings, 22 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.

/github/workspace/src/src/13185462.patch has style problems, please review.

NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO

NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.


##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[BlueZ,2/2] monitor: Fix printing Signed Write Command

WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search
6: B1 Line exceeds max length (83>80): " Handle: 0x006f Type: Vendor specific (f7debc9a-7856-3412-7856-341278563412)"
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
monitor/att.c: note: in included file:monitor/display.h:82:26: warning: Variable length array is used.monitor/att.c: note: in included file:monitor/display.h:82:26: warning: Variable length array is used.


---
Regards,
Linux Bluetooth

2023-03-23 20:57:59

by patchwork-bot+bluetooth

[permalink] [raw]
Subject: Re: [PATCH BlueZ 0/2] monitor

Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <[email protected]>:

On Thu, 23 Mar 2023 11:28:56 +0100 you wrote:
> Hello!
>
> I'm sending some fixes to btmon.
>
> Best regards.
>
> Simon Mikuda (2):
> monitor: Fix crash when there is no write handler
> monitor: Fix printing Signed Write Command
>
> [...]

Here is the summary with links:
- [BlueZ,1/2] monitor: Fix crash when there is no write handler
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=446e13360dba
- [BlueZ,2/2] monitor: Fix printing Signed Write Command
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=648b4362521b

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