chiark / gitweb /
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)
commite8a0782f42c256c06905e0006ba4473b08ba3bf7
treeaebb12cee825d95c8cf757438733e24fee4bbfe5
parentefacf9e0049ac05c817a88158d0cce5ea9d81b09
slip: tolerate SLIP decoding errors.

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>
slip.c