summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2017-03-22 12:45:23 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2017-03-22 12:45:23 +0000
commit65006b23b6b9838899b25be89309f4a2e22a3548 (patch)
tree3f42396b786aa86a77487873f27b2fa29a177e30 /sys
parentc190c6f7632923e604c9ea00fa7d42c643c35a23 (diff)
Replace an expensive microtime call with a getmicrotime for if_lastchange
reducing its resolution to 10ms. ok florian, mpi
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index c34b5b067f8..3004adcae68 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.491 2017/03/17 17:19:16 mpi Exp $ */
+/* $OpenBSD: if.c,v 1.492 2017/03/22 12:45:22 mikeb Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -1508,7 +1508,7 @@ if_down(struct ifnet *ifp)
splsoftassert(IPL_SOFTNET);
ifp->if_flags &= ~IFF_UP;
- microtime(&ifp->if_lastchange);
+ getmicrotime(&ifp->if_lastchange);
TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
pfctlinput(PRC_IFDOWN, ifa->ifa_addr);
}
@@ -1527,7 +1527,7 @@ if_up(struct ifnet *ifp)
splsoftassert(IPL_SOFTNET);
ifp->if_flags |= IFF_UP;
- microtime(&ifp->if_lastchange);
+ getmicrotime(&ifp->if_lastchange);
#ifdef INET6
/* Userland expects the kernel to set ::1 on default lo(4). */
@@ -2158,7 +2158,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p)
}
if (((oif_flags ^ ifp->if_flags) & IFF_UP) != 0)
- microtime(&ifp->if_lastchange);
+ getmicrotime(&ifp->if_lastchange);
return (error);
}