diff options
author | brian <brian@FreeBSD.org> | 1997-06-18 02:50:40 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-06-18 02:50:40 +0000 |
commit | e981ebde8f074db7e2cc779cb4d149b79f41769f (patch) | |
tree | f373ec1597b7eddd308df4c64bfb584f9c7ace60 /sys/net | |
parent | 11e41c0eef91d9b8fdbd8fb25795be915b29414f (diff) | |
download | FreeBSD-src-e981ebde8f074db7e2cc779cb4d149b79f41769f.zip FreeBSD-src-e981ebde8f074db7e2cc779cb4d149b79f41769f.tar.gz |
Protect against garbage mbufs in pppstart.
Remove previous hack in pppfcs().
This is still not the correct solution. We shouldn't
have any incorrect mbufs. This patch does however make
pppd/natd work (rather than jamming the interface).
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/ppp_tty.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/net/ppp_tty.c b/sys/net/ppp_tty.c index 934436d..7735edf 100644 --- a/sys/net/ppp_tty.c +++ b/sys/net/ppp_tty.c @@ -70,7 +70,7 @@ * Paul Mackerras (paulus@cs.anu.edu.au). */ -/* $Id: ppp_tty.c,v 1.18 1997/06/02 08:19:06 dfr Exp $ */ +/* $Id: ppp_tty.c,v 1.19 1997/06/09 04:13:48 brian Exp $ */ /* from Id: ppp_tty.c,v 1.3 1995/08/16 01:36:40 paulus Exp */ /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */ @@ -571,7 +571,7 @@ pppfcs(fcs, cp, len) register u_char *cp; register int len; { - while (len-- > 0) + while (len--) fcs = PPP_FCS(fcs, *cp++); return (fcs); } @@ -641,6 +641,11 @@ pppstart(tp) } s = spltty(); /* in case.. do not want netisrs to preempt us */ + + m = sc->sc_outm; + if (m && m->m_len < 0) + MFREE(m, sc->sc_outm); + idle = 0; while (CCOUNT(&tp->t_outq) < PPP_HIWAT) { /* |