chiark / gitweb /
server/tun-slip.c: Fix signed/unsigned char mismatch.
[tripe] / server / tun-slip.c
index e807662a7532b23fe80fd15702b5e1c3169bb3bc..85e9cd84da4ef6ab407579343d5bda7d41781505 100644 (file)
@@ -121,9 +121,10 @@ static void t_read(int fd, unsigned mode, void *v)
       case SL_END:
        if (st & ST_BAD)
          ;
-       else if (st & ST_ESC)
+       else if (st & ST_ESC) {
          a_warn("TUN", "%s", p_ifname(t->p), "slip", "escape-end", A_END);
-       else if (q == t->buf) {
+         st |= ST_BAD;
+       } else if (q == t->buf) {
          T( trace(T_TUNNEL, "tun-slip: empty packet"); )
        } else {
          IF_TRACING(T_TUNNEL, {
@@ -289,7 +290,7 @@ static tunnel *t_create(peer *p, int fd, char **ifn)
   dstr d = DSTR_INIT;
   unsigned char ch;
   tunnel *t;
-  static const char end[] = { SL_END, SL_END };
+  static const octet end[] = { SL_END, SL_END };
 
   /* --- Try to find a spare static interface --- */