From bd9a6a7bd8883c607a3a41ff3d7a340ae6ae1a1b Mon Sep 17 00:00:00 2001 From: gpalmer Date: Wed, 12 Jun 1996 19:24:03 +0000 Subject: Since the updates to ifnet.if_lastchange are so rare (relatively speaking), go for the extra accuracy and call microtime() to get the current time. Pointed Out By: bde --- sys/net/if.c | 18 +++++++++--------- sys/net/if_ppp.c | 4 ++-- sys/net/if_sl.c | 4 ++-- sys/net/if_tun.c | 4 ++-- sys/net/ppp_tty.c | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) (limited to 'sys/net') diff --git a/sys/net/if.c b/sys/net/if.c index e73fdb6..ce12fb8 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if.c 8.3 (Berkeley) 1/4/94 - * $Id: if.c,v 1.30 1996/06/05 17:12:41 wollman Exp $ + * $Id: if.c,v 1.31 1996/06/10 23:07:26 gpalmer Exp $ */ #include @@ -115,7 +115,7 @@ if_attach(ifp) p = &((*p)->if_next); *p = ifp; ifp->if_index = ++if_index; - ifp->if_lastchange = time; + microtime(&ifp->if_lastchange); if (ifnet_addrs == 0 || if_index >= if_indexlim) { unsigned n = (if_indexlim <<= 1) * sizeof(ifa); struct ifaddr **q = (struct ifaddr **) @@ -357,7 +357,7 @@ if_down(ifp) register struct ifaddr *ifa; ifp->if_flags &= ~IFF_UP; - ifp->if_lastchange = time; + microtime(&ifp->if_lastchange); for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) pfctlinput(PRC_IFDOWN, ifa->ifa_addr); if_qflush(&ifp->if_snd); @@ -375,7 +375,7 @@ if_up(ifp) { ifp->if_flags |= IFF_UP; - ifp->if_lastchange = time; + microtime(&ifp->if_lastchange); #ifdef notyet register struct ifaddr *ifa; /* this has no effect on IP, and will kill all iso connections XXX */ @@ -528,7 +528,7 @@ ifioctl(so, cmd, data, p) (ifr->ifr_flags &~ IFF_CANTCHANGE); if (ifp->if_ioctl) (void) (*ifp->if_ioctl)(ifp, cmd, data); - ifp->if_lastchange = time; + microtime(&ifp->if_lastchange); break; case SIOCSIFMETRIC: @@ -536,7 +536,7 @@ ifioctl(so, cmd, data, p) if (error) return (error); ifp->if_metric = ifr->ifr_metric; - ifp->if_lastchange = time; + microtime(&ifp->if_lastchange); break; case SIOCSIFPHYS: @@ -547,7 +547,7 @@ ifioctl(so, cmd, data, p) return EOPNOTSUPP; error = (*ifp->if_ioctl)(ifp, cmd, data); if (error == 0) - ifp->if_lastchange = time; + microtime(&ifp->if_lastchange); return(error); case SIOCSIFMTU: @@ -564,7 +564,7 @@ ifioctl(so, cmd, data, p) return (EINVAL); error = (*ifp->if_ioctl)(ifp, cmd, data); if (error == 0) - ifp->if_lastchange = time; + microtime(&ifp->if_lastchange); return(error); case SIOCADDMULTI: @@ -576,7 +576,7 @@ ifioctl(so, cmd, data, p) return (EOPNOTSUPP); error = (*ifp->if_ioctl)(ifp, cmd, data); if (error == 0 ) - ifp->if_lastchange = time; + microtime(&ifp->if_lastchange); return(error); default: diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c index c1ba804..0e677d1 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.33 1996/04/13 12:45:33 bde Exp $ */ +/* $Id: if_ppp.c,v 1.34 1996/06/10 23:07:33 gpalmer Exp $ */ /* from if_ppp.c,v 1.5 1995/08/16 01:36:38 paulus Exp */ /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */ @@ -258,7 +258,7 @@ pppdealloc(sc) if_down(&sc->sc_if); sc->sc_if.if_flags &= ~(IFF_UP|IFF_RUNNING); - sc->sc_if.if_lastchange = time; + microtime(&sc->sc_if.if_lastchange); sc->sc_devp = NULL; sc->sc_xfer = 0; for (;;) { diff --git a/sys/net/if_sl.c b/sys/net/if_sl.c index 3cf39f3..8200a1d 100644 --- a/sys/net/if_sl.c +++ b/sys/net/if_sl.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if_sl.c 8.6 (Berkeley) 2/1/94 - * $Id: if_sl.c,v 1.41 1996/05/13 14:18:18 ache Exp $ + * $Id: if_sl.c,v 1.42 1996/06/10 23:07:34 gpalmer Exp $ */ /* @@ -302,7 +302,7 @@ slopen(dev, tp) s = splnet(); if_up(&sc->sc_if); - sc->sc_if.if_lastchange = time; + microtime(&sc->sc_if.if_lastchange); splx(s); return (0); } diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 7efab59..c74af18 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -194,7 +194,7 @@ tunclose(dev_t dev, int foo, int bar, struct proc *p) if (ifp->if_flags & IFF_UP) { s = splimp(); if_down(ifp); - ifp->if_lastchange = time; + microtime(&ifp->if_lastchange); if (ifp->if_flags & IFF_RUNNING) { /* find internet addresses and delete routes */ register struct ifaddr *ifa; @@ -225,7 +225,7 @@ tuninit(unit) TUNDEBUG("%s%d: tuninit\n", ifp->if_name, ifp->if_unit); ifp->if_flags |= IFF_UP | IFF_RUNNING; - ifp->if_lastchange = time; + microtime(&ifp->if_lastchange); for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) if (ifa->ifa_addr->sa_family == AF_INET) { diff --git a/sys/net/ppp_tty.c b/sys/net/ppp_tty.c index 5915310d..c9a395b 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.5 1996/01/24 21:09:25 phk Exp $ */ +/* $Id: ppp_tty.c,v 1.6 1996/06/10 23:07:36 gpalmer Exp $ */ /* from Id: ppp_tty.c,v 1.3 1995/08/16 01:36:40 paulus Exp */ /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */ @@ -248,7 +248,7 @@ pppopen(dev, tp) sc->sc_outm = NULL; pppgetm(sc); sc->sc_if.if_flags |= IFF_RUNNING; - sc->sc_if.if_lastchange = time; + microtime(&sc->sc_if.if_lastchange); sc->sc_if.if_baudrate = tp->t_ospeed; tp->t_sc = (caddr_t) sc; -- cgit v1.1