From 001b230b10ce2b0fbba2ceb6d84c53e01b5f53c1 Mon Sep 17 00:00:00 2001 From: Oliver Hartkopp Date: Mon, 18 Mar 2024 12:35:29 +0100 Subject: [PATCH] cangen: initialize reserved struct CAN(FD) frame elements With 'cansend' and other tools the reserved elements are set to zero. Fix this missing initialization in 'cangen'. Signed-off-by: Oliver Hartkopp --- cangen.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cangen.c b/cangen.c index 4e272611..3c904b51 100644 --- a/cangen.c +++ b/cangen.c @@ -838,7 +838,10 @@ int main(int argc, char **argv) return 1; while (running) { + /* clear values but preserve cu.fd.len */ cu.fd.flags = 0; + cu.fd.__res0 = 0; + cu.fd.__res1 = 0; if (count && (--count == 0)) running = 0;