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).
This commit is contained in:
Brian Somers 1997-06-18 02:50:40 +00:00
parent 34f52ab279
commit 443e72b45a
1 changed files with 7 additions and 2 deletions

View File

@ -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) {
/*