From c3ff5d1bdc7207d94232157b7ccb51d02f31d1fc Mon Sep 17 00:00:00 2001 From: ache Date: Wed, 29 Mar 1995 20:34:17 +0000 Subject: [PATCH] pppinput: Fix serial errors handling Add no carrier check --- sys/net/if_ppp.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c index 7fa9d1f00906..6adb5128d165 100644 --- a/sys/net/if_ppp.c +++ b/sys/net/if_ppp.c @@ -69,7 +69,7 @@ * Paul Mackerras (paulus@cs.anu.edu.au). */ -/* $Id: if_ppp.c,v 1.10 1995/02/13 02:09:13 ache Exp $ */ +/* $Id: if_ppp.c,v 1.11 1995/03/20 19:20:42 wollman Exp $ */ /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */ #include "ppp.h" @@ -1284,14 +1284,18 @@ pppinput(c, tp) ++sc->sc_bytesrcvd; - if (c & TTY_FE) { - /* framing error or overrun on this char - abort packet */ + if (!(tp->t_state & TS_CARR_ON) && !(tp->t_cflag & CLOCAL)) { if (sc->sc_flags & SC_DEBUG) - printf("ppp%d: bad char %x\n", sc->sc_if.if_unit, c); + printf("ppp%d: no carrier\n", sc->sc_if.if_unit); + goto flush; + } + if (c & TTY_ERRORMASK) { + if (sc->sc_flags & SC_DEBUG) + printf("ppp%d: line error %x\n", sc->sc_if.if_unit, c & TTY_ERRORMASK); goto flush; } - c &= 0xff; + c &= TTY_CHARMASK; if (c & 0x80) sc->sc_flags |= SC_RCV_B7_1;