diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 2004-06-24 19:35:28 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 2004-06-24 19:35:28 +0000 |
commit | c6cc17e855e1d9fe177fba41d00de6e89fdc852e (patch) | |
tree | bdc6bde04c820ca59fe49d60185cf6ac40b44e30 /sys/netinet | |
parent | 128dd71ffeec48b94e085c757b3626553d619e7c (diff) |
This moves access to wall and uptime variables in MI code,
encapsulating all such access into wall-defined functions
that makes sure locking is done as needed.
It also cleans up some uses of wall time vs. uptime some
places, but there is sure to be more of these needed as
well, particularily in MD code. Also, many current calls
to microtime() should probably be changed to getmicrotime(),
or to the {,get}microuptime() versions.
ok art@ deraadt@ aaron@ matthieu@ beck@ sturm@ millert@ others
"Oh, that is not your problem!" from miod@
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/ip_carp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 730b688076c..b4a87e8e552 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_carp.c,v 1.60 2004/06/10 17:00:06 mcbride Exp $ */ +/* $OpenBSD: ip_carp.c,v 1.61 2004/06/24 19:35:25 tholo Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff. All rights reserved. @@ -467,7 +467,7 @@ carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af) return; } - sc->sc_ac.ac_if.if_lastchange = time; + getmicrotime(&sc->sc_ac.ac_if.if_lastchange); sc->sc_ac.ac_if.if_ipackets++; sc->sc_ac.ac_if.if_ibytes += m->m_pkthdr.len; @@ -861,7 +861,7 @@ carp_send_ad(void *v) ch_ptr->carp_cksum = carp_cksum(m, len - sizeof(*ip)); m->m_data -= sizeof(*ip); - sc->sc_ac.ac_if.if_lastchange = time; + getmicrotime(&sc->sc_ac.ac_if.if_lastchange); sc->sc_ac.ac_if.if_opackets++; sc->sc_ac.ac_if.if_obytes += len; carpstats.carps_opackets++; @@ -929,7 +929,7 @@ carp_send_ad(void *v) ch_ptr->carp_cksum = carp_cksum(m, len - sizeof(*ip6)); m->m_data -= sizeof(*ip6); - sc->sc_ac.ac_if.if_lastchange = time; + getmicrotime(&sc->sc_ac.ac_if.if_lastchange); sc->sc_ac.ac_if.if_opackets++; sc->sc_ac.ac_if.if_obytes += len; carpstats.carps_opackets6++; |