X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=netbsd-1.1%2Fif_ppp.c;h=7a32ab406f7ecd6e6b4aa134c185fca08cbb63cf;hp=4f0072d40958e8cdca78cfd5279f9c8682608e8f;hb=2e5bd580090480746b8193eb83f2cec41552d28f;hpb=df0083eddd5f881551e4df3e7eb24ab24ecb5da7 diff --git a/netbsd-1.1/if_ppp.c b/netbsd-1.1/if_ppp.c index 4f0072d..7a32ab4 100644 --- a/netbsd-1.1/if_ppp.c +++ b/netbsd-1.1/if_ppp.c @@ -1,4 +1,4 @@ -/* $Id: if_ppp.c,v 1.4 1996/07/01 05:30:45 paulus Exp $ */ +/* $Id: if_ppp.c,v 1.6 1997/03/04 03:33:00 paulus Exp $ */ /* * if_ppp.c - Point-to-Point Protocol (PPP) Asynchronous driver. @@ -129,6 +129,9 @@ #include #endif +static int pppsioctl __P((struct ifnet *, u_long, caddr_t)); +static int pppoutput __P((struct ifnet *, struct mbuf *, + struct sockaddr *, struct rtentry *)); static void ppp_requeue __P((struct ppp_softc *)); static void ppp_outpkt __P((struct ppp_softc *)); static void ppp_ccp __P((struct ppp_softc *, struct mbuf *m, int rcvd)); @@ -529,7 +532,7 @@ pppioctl(sc, cmd, data, flag, p) /* * Process an ioctl request to the ppp network interface. */ -int +static int pppsioctl(ifp, cmd, data) register struct ifnet *ifp; u_long cmd; @@ -935,13 +938,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 */