From c43a168c6889eeaf427c93d1399bbb31543e5167 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Thu, 20 Aug 2020 09:26:47 +0200 Subject: [PATCH] canfdtest: fix frame consistency check This patch fixes the issue reported in: https://github.com/linux-can/can-utils/commit/d7f28a0ffe36f73fe08729202f9c49ca5cac1dd4 https://github.com/linux-can/can-utils/issues/236 Reported-by: https://github.com/ronitnvidia Fixes: d7f28a0ffe36 ("canfdtest: can_echo_dut(): check received frame for consistency") Signed-off-by: Marc Kleine-Budde --- canfdtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/canfdtest.c b/canfdtest.c index ba4bfe6..89364e1 100644 --- a/canfdtest.c +++ b/canfdtest.c @@ -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;