slip: tolerate SLIP decoding errors.
authorSimon Tatham <anakin@pobox.com>
Tue, 25 Jun 2013 17:44:38 +0000 (17:44 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 3 Jul 2013 22:16:22 +0000 (23:16 +0100)
slip_unstuff previously responded to bad SLIP encoding or an overlong
SLIP packet by terminating secnet completely with a fatal error or
assertion failure. It turns out that SLIP encoding corruption can
occur through external action (for example, if you attach gdb to
secnet then things get a bit confused when gdb suspends it) and so
this should be a handled error condition rather than a terminal panic.

Therefore, introduce a system whereby SLIP decoding errors result in a
warning log message followed by ignoring everything in the SLIP stream
up to the next (unescaped) END byte, whereupon we resynchronise and
start decoding again.

Signed-off-by: Simon Tatham <anakin@pobox.com>

No differences found