From: Simon Tatham Date: Tue, 25 Jun 2013 17:44:38 +0000 (+0000) Subject: slip: tolerate SLIP decoding errors. X-Git-Tag: debian/0.3.0_beta2~43 X-Git-Url: https://git.distorted.org.uk/~mdw/secnet/commitdiff_plain/e8a0782f42c256c06905e0006ba4473b08ba3bf7?hp=e8a0782f42c256c06905e0006ba4473b08ba3bf7 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 ---