summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-03-29 20:34:17 +0000
committerache <ache@FreeBSD.org>1995-03-29 20:34:17 +0000
commitc3ff5d1bdc7207d94232157b7ccb51d02f31d1fc (patch)
tree3153fce149191b291d22d78f8d6a9c072edcdc84 /sys/net
parente7aa4fbd2c82c3f5d8a645605709c4809027a60f (diff)
downloadFreeBSD-src-c3ff5d1bdc7207d94232157b7ccb51d02f31d1fc.zip
FreeBSD-src-c3ff5d1bdc7207d94232157b7ccb51d02f31d1fc.tar.gz
pppinput:
Fix serial errors handling Add no carrier check
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_ppp.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c
index 7fa9d1f..6adb512 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;
OpenPOWER on IntegriCloud