Use gettime() instead of assignment from `time'. (`time' is too

volatile to use outside of splclock().  microtime() is probably too
expensive to use for every i/o.  However, setting ifi_lastchange for
every i/o is just wrong according to the comment about ifi_lastchange
in <net/if.h>.  It is set then for atm, fddi and the latest version
of ppp.)
This commit is contained in:
Bruce Evans 1997-11-18 13:37:56 +00:00
parent d662024a0d
commit 16355bd11c
2 changed files with 5 additions and 6 deletions

View File

@ -38,7 +38,6 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/mbuf.h>
#include <sys/socket.h>
@ -106,7 +105,7 @@ atm_output(ifp, m0, dst, rt0)
if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING))
senderr(ENETDOWN);
ifp->if_lastchange = time;
gettime(&ifp->if_lastchange);
/*
* check route
@ -261,7 +260,7 @@ atm_input(ifp, ah, m, rxhand)
m_freem(m);
return;
}
ifp->if_lastchange = time;
gettime(&ifp->if_lastchange);
ifp->if_ibytes += m->m_pkthdr.len;
#if NBPFILTER > 0

View File

@ -33,7 +33,7 @@
* SUCH DAMAGE.
*
* from: if_ethersubr.c,v 1.5 1994/12/13 22:31:45 wollman Exp
* $Id: if_fddisubr.c,v 1.20 1997/08/02 14:32:36 bde Exp $
* $Id: if_fddisubr.c,v 1.21 1997/10/29 07:59:27 julian Exp $
*/
#include <sys/param.h>
@ -145,7 +145,7 @@ fddi_output(ifp, m0, dst, rt0)
if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING))
senderr(ENETDOWN);
ifp->if_lastchange = time;
gettime(&ifp->if_lastchange);
#if !defined(__bsdi__) || _BSDI_VERSION >= 199401
if (rt = rt0) {
if ((rt->rt_flags & RTF_UP) == 0) {
@ -470,7 +470,7 @@ fddi_input(ifp, fh, m)
m_freem(m);
return;
}
ifp->if_lastchange = time;
gettime(&ifp->if_lastchange);
ifp->if_ibytes += m->m_pkthdr.len + sizeof (*fh);
if (fh->fddi_dhost[0] & 1) {
if (bcmp((caddr_t)fddibroadcastaddr, (caddr_t)fh->fddi_dhost,