chiark / gitweb /
uslip: Fix SLIP escape handling.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 20 Dec 2008 11:39:32 +0000 (11:39 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 20 Dec 2008 11:39:32 +0000 (11:39 +0000)
In particular, do_slip_in failed to leave ESC mode having handled the
escaped character.

uslip/uslip.c

index a552ba9e952d2ce34489e9a1b7ea8f625609a978..eb60eb691d861bca510b2aff29e36291f8f6dfce 100644 (file)
@@ -521,9 +521,11 @@ static void do_slip_in(int fd, unsigned mode, void *hunoz)
          switch (buf[i]) {
            case SL_ESCEND:
              DPUTC(&slipbuf, SL_END);
+             slipstate = OK;
              break;
            case SL_ESCESC:
              DPUTC(&slipbuf, SL_ESC);
+             slipstate = OK;
              break;
            case SL_END:
              moan("found escaped end byte (discard packet and resync");
@@ -531,7 +533,7 @@ static void do_slip_in(int fd, unsigned mode, void *hunoz)
              slipstate = OK;
              break;
            default:
-             moan("unspected escape char 0x%02x", buf[i]);
+             moan("unexpected escape char 0x%02x", buf[i]);
              slipstate = BAD;
              break;
          }