X-Git-Url: https://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=ultrix%2Fif_ppp.c;h=9fd9b3151dac89cd3cb6eebddca1d966e13b4d35;hp=2c8316ee2e0b6cda9b2ce39b428a7952dd68099c;hb=82d99c4f3e3f102838b658d6170a80b2aeec8c43;hpb=3a2d78abba787b3563007f6ce22422550743ea71 diff --git a/ultrix/if_ppp.c b/ultrix/if_ppp.c index 2c8316e..9fd9b31 100644 --- a/ultrix/if_ppp.c +++ b/ultrix/if_ppp.c @@ -72,7 +72,7 @@ * Robert Olsson and Paul Mackerras. */ -/* $Id: if_ppp.c,v 1.7 1995/05/19 04:37:42 paulus Exp $ */ +/* $Id: if_ppp.c,v 1.8 1995/07/11 07:00:49 paulus Exp $ */ /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */ #include "ppp.h" @@ -1120,32 +1120,30 @@ ppp_inproc(sc, m) && !(sc->sc_flags & SC_DC_ERROR) && !(sc->sc_flags & SC_DC_FERROR)) { /* decompress this packet */ rv = (*sc->sc_rcomp->decompress)(sc->sc_rc_state, m, &dmp); - if (dmp != NULL) { + if (rv == DECOMP_OK) { m_freem(m); + if (dmp == NULL) { + /* no error, but no decompressed packet produced */ + return; + } m = dmp; cp = mtod(m, u_char *); proto = PPP_PROTOCOL(cp); } else { - /* pass the compressed packet up to pppd, which may take - CCP down or issue a Reset-Req. */ + /* + * An error has occurred in decompression. + * Pass the compressed packet up to pppd, which may take + * CCP down or issue a Reset-Req. + */ if (sc->sc_flags & SC_DEBUG) printf("ppp%d: decompress failed %d\n", sc->sc_if.if_unit, rv); - s = splimp(); + s = splhigh(); sc->sc_flags |= SC_VJ_RESET; - switch (rv) { - case DECOMP_OK: - /* no error, but no decompressed packet produced */ - splx(s); - m_freem(m); - return; - case DECOMP_ERROR: + if (rv == DECOMP_ERROR) sc->sc_flags |= SC_DC_ERROR; - break; - case DECOMP_FATALERROR: + else sc->sc_flags |= SC_DC_FERROR; - break; - } splx(s); }