canfdtest: fix frame consistency check

This patch fixes the issue reported in:

d7f28a0ffe
https://github.com/linux-can/can-utils/issues/236

Reported-by: https://github.com/ronitnvidia
Fixes: d7f28a0ffe ("canfdtest: can_echo_dut(): check received frame for consistency")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
pull/237/head
Marc Kleine-Budde 2020-08-20 09:26:47 +02:00
parent 58dc257e11
commit c43a168c68
1 changed files with 1 additions and 1 deletions

View File

@ -215,7 +215,7 @@ static int check_frame(const struct can_frame *frame)
}
for (i = 1; i < frame->can_dlc; i++) {
if (frame->data[i] != frame->data[i-1]) {
if (frame->data[i] != (uint8_t)(frame->data[i-1] + 1)) {
printf("Frame inconsistent!\n");
print_frame(frame, 0);
err = -1;