mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-06 13:09:50 +00:00
Use getmicrotime() for if_lastchange, 10msec is plenty precision.
This commit is contained in:
parent
2f5f6b74ca
commit
98b9590ef3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=35067
20
sys/net/if.c
20
sys/net/if.c
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)if.c 8.3 (Berkeley) 1/4/94
|
||||
* $Id: if.c,v 1.56 1997/10/28 15:58:30 bde Exp $
|
||||
* $Id: if.c,v 1.57 1997/12/16 17:40:34 eivind Exp $
|
||||
*/
|
||||
|
||||
#include "opt_compat.h"
|
||||
@ -128,7 +128,7 @@ if_attach(ifp)
|
||||
*/
|
||||
TAILQ_INIT(&ifp->if_addrhead);
|
||||
LIST_INIT(&ifp->if_multiaddrs);
|
||||
microtime(&ifp->if_lastchange);
|
||||
getmicrotime(&ifp->if_lastchange);
|
||||
if (ifnet_addrs == 0 || if_index >= if_indexlim) {
|
||||
unsigned n = (if_indexlim <<= 1) * sizeof(ifa);
|
||||
struct ifaddr **q = (struct ifaddr **)
|
||||
@ -406,7 +406,7 @@ if_down(ifp)
|
||||
register struct ifaddr *ifa;
|
||||
|
||||
ifp->if_flags &= ~IFF_UP;
|
||||
microtime(&ifp->if_lastchange);
|
||||
getmicrotime(&ifp->if_lastchange);
|
||||
for (ifa = ifp->if_addrhead.tqh_first; ifa;
|
||||
ifa = ifa->ifa_link.tqe_next)
|
||||
pfctlinput(PRC_IFDOWN, ifa->ifa_addr);
|
||||
@ -426,7 +426,7 @@ if_up(ifp)
|
||||
register struct ifaddr *ifa;
|
||||
|
||||
ifp->if_flags |= IFF_UP;
|
||||
microtime(&ifp->if_lastchange);
|
||||
getmicrotime(&ifp->if_lastchange);
|
||||
for (ifa = ifp->if_addrhead.tqh_first; ifa;
|
||||
ifa = ifa->ifa_link.tqe_next)
|
||||
pfctlinput(PRC_IFUP, ifa->ifa_addr);
|
||||
@ -576,7 +576,7 @@ ifioctl(so, cmd, data, p)
|
||||
(ifr->ifr_flags &~ IFF_CANTCHANGE);
|
||||
if (ifp->if_ioctl)
|
||||
(void) (*ifp->if_ioctl)(ifp, cmd, data);
|
||||
microtime(&ifp->if_lastchange);
|
||||
getmicrotime(&ifp->if_lastchange);
|
||||
break;
|
||||
|
||||
case SIOCSIFMETRIC:
|
||||
@ -584,7 +584,7 @@ ifioctl(so, cmd, data, p)
|
||||
if (error)
|
||||
return (error);
|
||||
ifp->if_metric = ifr->ifr_metric;
|
||||
microtime(&ifp->if_lastchange);
|
||||
getmicrotime(&ifp->if_lastchange);
|
||||
break;
|
||||
|
||||
case SIOCSIFPHYS:
|
||||
@ -595,7 +595,7 @@ ifioctl(so, cmd, data, p)
|
||||
return EOPNOTSUPP;
|
||||
error = (*ifp->if_ioctl)(ifp, cmd, data);
|
||||
if (error == 0)
|
||||
microtime(&ifp->if_lastchange);
|
||||
getmicrotime(&ifp->if_lastchange);
|
||||
return(error);
|
||||
|
||||
case SIOCSIFMTU:
|
||||
@ -612,7 +612,7 @@ ifioctl(so, cmd, data, p)
|
||||
return (EINVAL);
|
||||
error = (*ifp->if_ioctl)(ifp, cmd, data);
|
||||
if (error == 0)
|
||||
microtime(&ifp->if_lastchange);
|
||||
getmicrotime(&ifp->if_lastchange);
|
||||
return(error);
|
||||
|
||||
case SIOCADDMULTI:
|
||||
@ -636,7 +636,7 @@ ifioctl(so, cmd, data, p)
|
||||
error = if_delmulti(ifp, &ifr->ifr_addr);
|
||||
}
|
||||
if (error == 0)
|
||||
microtime(&ifp->if_lastchange);
|
||||
getmicrotime(&ifp->if_lastchange);
|
||||
return error;
|
||||
|
||||
case SIOCSIFMEDIA:
|
||||
@ -648,7 +648,7 @@ ifioctl(so, cmd, data, p)
|
||||
return (EOPNOTSUPP);
|
||||
error = (*ifp->if_ioctl)(ifp, cmd, data);
|
||||
if (error == 0)
|
||||
microtime(&ifp->if_lastchange);
|
||||
getmicrotime(&ifp->if_lastchange);
|
||||
return error;
|
||||
|
||||
case SIOCGIFMEDIA:
|
||||
|
@ -69,7 +69,7 @@
|
||||
* Paul Mackerras (paulus@cs.anu.edu.au).
|
||||
*/
|
||||
|
||||
/* $Id: if_ppp.c,v 1.54 1998/03/22 06:51:54 peter Exp $ */
|
||||
/* $Id: if_ppp.c,v 1.55 1998/03/30 09:51:52 phk 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 */
|
||||
|
||||
@ -291,7 +291,7 @@ pppdealloc(sc)
|
||||
|
||||
if_down(&sc->sc_if);
|
||||
sc->sc_if.if_flags &= ~(IFF_UP|IFF_RUNNING);
|
||||
microtime(&sc->sc_if.if_lastchange);
|
||||
getmicrotime(&sc->sc_if.if_lastchange);
|
||||
sc->sc_devp = NULL;
|
||||
sc->sc_xfer = 0;
|
||||
for (;;) {
|
||||
|
@ -229,7 +229,7 @@ tuninit(unit)
|
||||
TUNDEBUG("%s%d: tuninit\n", ifp->if_name, ifp->if_unit);
|
||||
|
||||
ifp->if_flags |= IFF_UP | IFF_RUNNING;
|
||||
microtime(&ifp->if_lastchange);
|
||||
getmicrotime(&ifp->if_lastchange);
|
||||
|
||||
for (ifa = ifp->if_addrhead.tqh_first; ifa;
|
||||
ifa = ifa->ifa_link.tqe_next) {
|
||||
|
@ -70,7 +70,7 @@
|
||||
* Paul Mackerras (paulus@cs.anu.edu.au).
|
||||
*/
|
||||
|
||||
/* $Id: ppp_tty.c,v 1.31 1998/03/28 10:33:12 bde Exp $ */
|
||||
/* $Id: ppp_tty.c,v 1.32 1998/03/30 09:52:14 phk Exp $ */
|
||||
|
||||
#include "ppp.h"
|
||||
#if NPPP > 0
|
||||
@ -245,7 +245,7 @@ pppopen(dev, tp)
|
||||
sc->sc_outm = NULL;
|
||||
pppgetm(sc);
|
||||
sc->sc_if.if_flags |= IFF_RUNNING;
|
||||
microtime(&sc->sc_if.if_lastchange);
|
||||
getmicrotime(&sc->sc_if.if_lastchange);
|
||||
sc->sc_if.if_baudrate = tp->t_ospeed;
|
||||
|
||||
tp->t_sc = (caddr_t) sc;
|
||||
|
Loading…
Reference in New Issue
Block a user