Merge Fedora Core 2 Updates kernel-2.6.10-1.771_FC2
[linux-2.6.git] / drivers / net / ppp_async.c
index ae5255a..73ecae1 100644 (file)
@@ -266,7 +266,7 @@ ppp_asynctty_read(struct tty_struct *tty, struct file *file,
  */
 static ssize_t
 ppp_asynctty_write(struct tty_struct *tty, struct file *file,
-                  const unsigned char __user *buf, size_t count)
+                  const unsigned char *buf, size_t count)
 {
        return -EAGAIN;
 }
@@ -686,7 +686,7 @@ ppp_async_push(struct asyncppp *ap)
                if (!tty_stuffed && ap->optr < ap->olim) {
                        avail = ap->olim - ap->optr;
                        set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
-                       sent = tty->driver->write(tty, 0, ap->optr, avail);
+                       sent = tty->driver->write(tty, ap->optr, avail);
                        if (sent < 0)
                                goto flush;     /* error, e.g. loss of CD */
                        ap->optr += sent;
@@ -911,7 +911,9 @@ ppp_async_input(struct asyncppp *ap, const unsigned char *buf,
                        break;
 
                c = buf[n];
-               if (c == PPP_FLAG) {
+               if (flags != NULL && flags[n] != 0) {
+                       ap->state |= SC_TOSS;
+               } else if (c == PPP_FLAG) {
                        process_input_packet(ap);
                } else if (c == PPP_ESCAPE) {
                        ap->state |= SC_ESCAPE;
@@ -998,7 +1000,7 @@ static void async_lcp_peek(struct asyncppp *ap, unsigned char *data,
        data += 4;
        dlen -= 4;
        /* data[0] is code, data[1] is length */
-       while (dlen >= 2 && dlen >= data[1]) {
+       while (dlen >= 2 && dlen >= data[1] && data[1] >= 2) {
                switch (data[0]) {
                case LCP_MRU:
                        val = (data[2] << 8) + data[3];