diff options
author | peter <peter@FreeBSD.org> | 1997-08-22 11:34:08 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1997-08-22 11:34:08 +0000 |
commit | 06ac8bc3a120588b5eb56e14b7217177fcb19c87 (patch) | |
tree | 56d2fa7a971251b6b8a43b2b039fa285dfce75e3 | |
parent | cfa61a951848d15a8ca71f15d9e33be9730adb68 (diff) | |
download | FreeBSD-src-06ac8bc3a120588b5eb56e14b7217177fcb19c87.zip FreeBSD-src-06ac8bc3a120588b5eb56e14b7217177fcb19c87.tar.gz |
Some fixes from Bruce:
- don't access time (a volatile) via struct copy.
- merge botches
- note risk of CCOUNT accessing *tp outside spltty().
Submitted by: bde
-rw-r--r-- | sys/net/if_ppp.c | 8 | ||||
-rw-r--r-- | sys/net/ppp_tty.c | 10 |
2 files changed, 10 insertions, 8 deletions
diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c index 179dc3a..4160fe3 100644 --- a/sys/net/if_ppp.c +++ b/sys/net/if_ppp.c @@ -69,7 +69,7 @@ * Paul Mackerras (paulus@cs.anu.edu.au). */ -/* $Id: if_ppp.c,v 1.42 1997/08/19 14:10:45 peter Exp $ */ +/* $Id: if_ppp.c,v 1.43 1997/08/19 17:05:26 peter 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 */ @@ -283,7 +283,7 @@ pppdealloc(sc) if_down(&sc->sc_if); sc->sc_if.if_flags &= ~(IFF_UP|IFF_RUNNING); - microtime(&sc->sc_if.if_lastchange); + gettime(&sc->sc_if.if_lastchange); sc->sc_devp = NULL; sc->sc_xfer = 0; for (;;) { @@ -854,7 +854,7 @@ pppoutput(ifp, m0, dst, rtp) IF_ENQUEUE(ifq, m0); (*sc->sc_start)(sc); } - ifp->if_lastchange = time; + gettime(&ifp->if_lastchange); ifp->if_opackets++; ifp->if_obytes += len; @@ -1530,7 +1530,7 @@ ppp_inproc(sc, m) splx(s); ifp->if_ipackets++; ifp->if_ibytes += ilen; - ifp->if_lastchange = time; + gettime(&ifp->if_lastchange); if (rv) (*sc->sc_ctlp)(sc); diff --git a/sys/net/ppp_tty.c b/sys/net/ppp_tty.c index c6f07ef..d830c60 100644 --- a/sys/net/ppp_tty.c +++ b/sys/net/ppp_tty.c @@ -70,7 +70,7 @@ * Paul Mackerras (paulus@cs.anu.edu.au). */ -/* $Id: ppp_tty.c,v 1.21 1997/06/22 02:19:52 brian Exp $ */ +/* $Id: ppp_tty.c,v 1.22 1997/08/19 14:10:47 peter Exp $ */ #include "ppp.h" #if NPPP > 0 @@ -383,7 +383,7 @@ pppread(tp, uio, flag) splx(s); return (EWOULDBLOCK); } - error = ttysleep(tp, (caddr_t)&tp->t_rawq, TTIPRI | PCATCH, "ttyin", 0); + error = ttysleep(tp, TSA_HUP_OR_INPUT(tp), TTIPRI | PCATCH, "pppin", 0); if (error) { splx(s); return error; @@ -597,6 +597,7 @@ pppasyncstart(sc) int s; idle = 0; + /* XXX assumes atomic access to *tp although we're not at spltty(). */ while (CCOUNT(&tp->t_outq) < PPP_HIWAT) { /* * See if we have an existing packet partly sent. @@ -618,6 +619,7 @@ pppasyncstart(sc) * will flush any accumulated garbage. We do this whenever * the line may have been idle for some time. */ + /* XXX as above. */ if (CCOUNT(&tp->t_outq) == 0) { ++sc->sc_stats.ppp_obytes; (void) putc(PPP_FLAG, &tp->t_outq); @@ -625,7 +627,7 @@ pppasyncstart(sc) /* Calculate the FCS for the first mbuf's worth. */ sc->sc_outfcs = pppfcs(PPP_INITFCS, mtod(m, u_char *), m->m_len); - sc->sc_if.if_lastchange = time; + gettime(&sc->sc_if.if_lastchange); } for (;;) { @@ -795,7 +797,7 @@ pppstart(tp) register struct ppp_softc *sc = (struct ppp_softc *) tp->t_sc; /* - * If there is stuff in the output queue, send it now. + * Call output process whether or not there is any output. * We are being called in lieu of ttstart and must do what it would. */ if (tp->t_oproc != NULL) |