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 a552ba9..eb60eb6 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;
          }