]> rtime.felk.cvut.cz Git - sojka/can-utils.git/commit
slcanpty: handle incomplete messages from pty correctly
authorOliver Hartkopp <socketcan@hartkopp.net>
Sat, 8 Jun 2013 10:57:17 +0000 (12:57 +0200)
committerOliver Hartkopp <socketcan@hartkopp.net>
Sat, 8 Jun 2013 10:57:17 +0000 (12:57 +0200)
commitc9422deb0b83a4e21ad3bb81495e8a9acf43664d
treee936ecb330cb7e7d046168c1bb683a0a3516214c
parent704d5f22d1d2502ddcd4e231b733eeb642112653
slcanpty: handle incomplete messages from pty correctly

Make sure that we have minimum one complete SLCAN messages from pty in the
receive buffer before we start processing the received SLCAN message.

Fragments of a received incomplete message are stored to be appended by the
next read() syscall in pty2can().

This patch is a rework of an initial patch from Ulrich Escher. Tnx!

Reported-by: Ulrich Escher <git@myvdr.de>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
slcanpty.c