Skip to content

Commit

Permalink
cangen: initialize reserved struct CAN(FD) frame elements
Browse files Browse the repository at this point in the history
With 'cansend' and other tools the reserved elements are set to zero.
Fix this missing initialization in 'cangen'.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
  • Loading branch information
hartkopp committed Mar 18, 2024
1 parent 6d47f5c commit 001b230
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cangen.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 001b230

Please sign in to comment.