diff options
| author | Atsushi Murai <amurai@FreeBSD.org> | 1995-02-26 12:18:08 +0000 |
|---|---|---|
| committer | Atsushi Murai <amurai@FreeBSD.org> | 1995-02-26 12:18:08 +0000 |
| commit | 53c9f6c0c48df668bb8fa282cd0b12cb8690bcce (patch) | |
| tree | d05da3a88d3d54962fad8582d501f1b7ad9500b9 /usr.sbin/ppp/async.c | |
| parent | 550f8550ec70dde086df88fb9d38b44410d299bc (diff) | |
Notes
Diffstat (limited to 'usr.sbin/ppp/async.c')
| -rw-r--r-- | usr.sbin/ppp/async.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/usr.sbin/ppp/async.c b/usr.sbin/ppp/async.c index d518162865091..d6777b511ec71 100644 --- a/usr.sbin/ppp/async.c +++ b/usr.sbin/ppp/async.c @@ -18,20 +18,20 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * $Id:$ - * + * */ #include "fsm.h" #include "hdlc.h" #include "lcp.h" #include "lcpproto.h" #include "modem.h" +#include "vars.h" #define HDLCSIZE (MAX_MRU*2+6) struct async_state { int mode; int length; - struct mbuf *hpacket; u_char hbuff[HDLCSIZE]; /* recv buffer */ u_char xbuff[HDLCSIZE]; /* xmit buffer */ u_long my_accmap; @@ -47,6 +47,7 @@ AsyncInit() struct async_state *stp = &AsyncState; stp->mode = MODE_HUNT; + stp->length = 0; stp->my_accmap = stp->his_accmap = 0xffffffff; } @@ -176,10 +177,17 @@ int cnt; struct mbuf *bp; OsAddInOctets(cnt); - while (cnt > 0) { - bp = AsyncDecode(*buff++); - if (bp) - HdlcInput(bp); - cnt--; + if (DEV_IS_SYNC) { + bp = mballoc(cnt, MB_ASYNC); + bcopy(buff, MBUF_CTOP(bp), cnt); + bp->cnt = cnt; + HdlcInput(bp); + } else { + while (cnt > 0) { + bp = AsyncDecode(*buff++); + if (bp) + HdlcInput(bp); + cnt--; + } } } |
