From 6ee9772e5407e39897bc273fe1db157f74c1ca77 Mon Sep 17 00:00:00 2001 From: sommerfe Date: Sun, 2 Aug 1998 15:09:50 +0000 Subject: [PATCH] Fix PR5898: ppp delays last packet. --- sys/net/if_ppp.c | 5 +++-- sys/net/ppp_tty.c | 14 +++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c index 1987637ea71a..a995a2c732d6 100644 --- a/sys/net/if_ppp.c +++ b/sys/net/if_ppp.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ppp.c,v 1.45 1998/07/09 22:30:01 thorpej Exp $ */ +/* $NetBSD: if_ppp.c,v 1.46 1998/08/02 15:09:50 sommerfe Exp $ */ /* Id: if_ppp.c,v 1.6 1997/03/04 03:33:00 paulus Exp */ /* @@ -1021,7 +1021,8 @@ pppintr() s = splsoftnet(); for (i = 0; i < NPPP; ++i, ++sc) { if (!(sc->sc_flags & SC_TBUSY) - && (sc->sc_if.if_snd.ifq_head || sc->sc_fastq.ifq_head)) { + && (sc->sc_if.if_snd.ifq_head || sc->sc_fastq.ifq_head + || sc->sc_outm)) { s2 = splimp(); sc->sc_flags |= SC_TBUSY; splx(s2); diff --git a/sys/net/ppp_tty.c b/sys/net/ppp_tty.c index 3ddbf468f7a0..5d906aac02e4 100644 --- a/sys/net/ppp_tty.c +++ b/sys/net/ppp_tty.c @@ -1,4 +1,4 @@ -/* $NetBSD: ppp_tty.c,v 1.13 1997/03/25 22:33:25 christos Exp $ */ +/* $NetBSD: ppp_tty.c,v 1.14 1998/08/02 15:09:50 sommerfe Exp $ */ /* Id: ppp_tty.c,v 1.3 1996/07/01 01:04:11 paulus Exp */ /* @@ -119,7 +119,7 @@ int pppwrite __P((struct tty *tp, struct uio *uio, int flag)); int ppptioctl __P((struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *)); int pppinput __P((int c, struct tty *tp)); -int pppstart __P((struct tty *tp, int)); +int pppstart __P((struct tty *tp)); static u_int16_t pppfcs __P((u_int16_t fcs, u_char *cp, int len)); static void pppasyncstart __P((struct ppp_softc *)); @@ -664,7 +664,7 @@ pppasyncstart(sc) /* Call pppstart to start output again if necessary. */ s = spltty(); - pppstart(tp, 0); + pppstart(tp); /* * This timeout is needed for operation on a pseudo-tty, @@ -705,9 +705,8 @@ pppasyncctlp(sc) * Called at spltty or higher. */ int -pppstart(tp, force) +pppstart(tp) register struct tty *tp; - int force; { register struct ppp_softc *sc = (struct ppp_softc *) tp->t_sc; @@ -723,7 +722,8 @@ pppstart(tp, force) * or been disconnected from the ppp unit, then tell if_ppp.c that * we need more output. */ - if (CCOUNT(&tp->t_outq) >= PPP_LOWAT && !force) + if ((CCOUNT(&tp->t_outq) >= PPP_LOWAT) + && ((sc == NULL) || (sc->sc_flags & SC_TIMEOUT))) return 0; if (!((tp->t_state & TS_CARR_ON) == 0 && (tp->t_cflag & CLOCAL) == 0) && sc != NULL && tp == (struct tty *) sc->sc_devp) { @@ -746,7 +746,7 @@ ppp_timeout(x) s = spltty(); sc->sc_flags &= ~SC_TIMEOUT; - pppstart(tp, 1); + pppstart(tp); splx(s); }