X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=freebsd-2.0%2Fif_ppp.c;h=4388646c63373b9d6ae24fb89cae95e53c8241fd;hp=2d195dd469e7537117f53fdc431fe6b72b3a35e9;hb=21cdaec64fc3385795f4318fdf2358f503ec26ba;hpb=e3c0dd4a0dffbdfe2fa8da1124f455d8d7994594 diff --git a/freebsd-2.0/if_ppp.c b/freebsd-2.0/if_ppp.c index 2d195dd..4388646 100644 --- a/freebsd-2.0/if_ppp.c +++ b/freebsd-2.0/if_ppp.c @@ -69,7 +69,7 @@ * Paul Mackerras (paulus@cs.anu.edu.au). */ -/* $Id: if_ppp.c,v 1.8 1996/07/01 05:25:55 paulus Exp $ */ +/* $Id: if_ppp.c,v 1.10 1996/10/08 04:38:03 paulus Exp $ */ /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */ /* from NetBSD: if_ppp.c,v 1.15.2.2 1994/07/28 05:17:58 cgd Exp */ @@ -234,7 +234,7 @@ pppalloc(pid) sc->sc_relinq = NULL; bzero((char *)&sc->sc_stats, sizeof(sc->sc_stats)); #ifdef VJC - MALLOC(sc->sc_comp, struct slcompress *, sizeof(struct slcompress), + MALLOC(sc->sc_comp, struct vjcompress *, sizeof(struct vjcompress), M_DEVBUF, M_NOWAIT); if (sc->sc_comp) vj_compress_init(sc->sc_comp, -1); @@ -890,13 +890,18 @@ ppp_dequeue(sc) for (mp = m; mp != NULL; mp = mp->m_next) slen += mp->m_len; clen = (*sc->sc_xcomp->compress) - (sc->sc_xc_state, &mcomp, m, slen, - (sc->sc_flags & SC_CCP_UP? sc->sc_if.if_mtu: 0)); + (sc->sc_xc_state, &mcomp, m, slen, sc->sc_if.if_mtu + PPP_HDRLEN); if (mcomp != NULL) { - m_freem(m); - m = mcomp; - cp = mtod(m, u_char *); - protocol = cp[3]; + if (sc->sc_flags & SC_CCP_UP) { + /* Send the compressed packet instead of the original. */ + m_freem(m); + m = mcomp; + cp = mtod(m, u_char *); + protocol = cp[3]; + } else { + /* Can't transmit compressed packets until CCP is up. */ + m_freem(mcomp); + } } } #endif /* PPP_COMPRESS */