diff options
author | hrs <hrs@FreeBSD.org> | 2013-08-05 20:13:02 +0000 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2013-08-05 20:13:02 +0000 |
commit | 13c1bcf2c1d5fbdca99cdddec726f822b68dddbc (patch) | |
tree | c3af796aa3d9d6e1a9fa48bdec823e34beac7892 /usr.sbin/rtsold/rtsol.c | |
parent | 103825c951713677489b0556d7cd86852ec2969c (diff) | |
download | FreeBSD-src-13c1bcf2c1d5fbdca99cdddec726f822b68dddbc.zip FreeBSD-src-13c1bcf2c1d5fbdca99cdddec726f822b68dddbc.tar.gz |
- Use time_uptime instead of time_second in data structures for
PF_INET6 in kernel. This fixes various malfunction when the wall time
clock is changed. Bump __FreeBSD_version to 1000041.
- Use clock_gettime(CLOCK_MONOTONIC_FAST) in userland utilities.
MFC after: 1 month
Diffstat (limited to 'usr.sbin/rtsold/rtsol.c')
-rw-r--r-- | usr.sbin/rtsold/rtsol.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.sbin/rtsold/rtsol.c b/usr.sbin/rtsold/rtsol.c index 181012c..f7210f6 100644 --- a/usr.sbin/rtsold/rtsol.c +++ b/usr.sbin/rtsold/rtsol.c @@ -35,7 +35,6 @@ #include <sys/param.h> #include <sys/socket.h> #include <sys/uio.h> -#include <sys/time.h> #include <sys/queue.h> #include <sys/wait.h> #include <sys/stat.h> @@ -58,6 +57,7 @@ #include <fcntl.h> #include <unistd.h> #include <stdio.h> +#include <time.h> #include <err.h> #include <errno.h> #include <string.h> @@ -256,8 +256,8 @@ rtsol_input(int s) size_t len; char nsbuf[INET6_ADDRSTRLEN + 1 + IFNAMSIZ + 1]; char dname[NI_MAXHOST]; - struct timeval now; - struct timeval lifetime; + struct timespec now; + struct timespec lifetime; int newent_rai; int newent_rao; @@ -376,7 +376,7 @@ rtsol_input(int s) ifi->otherconfig = 1; CALL_SCRIPT(OTHER, NULL); } - gettimeofday(&now, NULL); + clock_gettime(CLOCK_MONOTONIC_FAST, &now); newent_rai = 0; rai = find_rainfo(ifi, &from); if (rai == NULL) { @@ -472,7 +472,7 @@ rtsol_input(int s) memset(&lifetime, 0, sizeof(lifetime)); lifetime.tv_sec = ntohl(rdnss->nd_opt_rdnss_lifetime); - timeradd(&now, &lifetime, &rao->rao_expire); + TS_ADD(&now, &lifetime, &rao->rao_expire); if (newent_rao) TAILQ_INSERT_TAIL(&rai->rai_ra_opt, @@ -531,7 +531,7 @@ rtsol_input(int s) memset(&lifetime, 0, sizeof(lifetime)); lifetime.tv_sec = ntohl(dnssl->nd_opt_dnssl_lifetime); - timeradd(&now, &lifetime, &rao->rao_expire); + TS_ADD(&now, &lifetime, &rao->rao_expire); if (newent_rao) TAILQ_INSERT_TAIL(&rai->rai_ra_opt, @@ -574,7 +574,7 @@ ra_opt_handler(struct ifinfo *ifi) struct ra_opt *rao; struct rainfo *rai; struct script_msg *smp1, *smp2, *smp3; - struct timeval now; + struct timespec now; struct script_msg_head_t sm_rdnss_head = TAILQ_HEAD_INITIALIZER(sm_rdnss_head); struct script_msg_head_t sm_dnssl_head = @@ -584,7 +584,7 @@ ra_opt_handler(struct ifinfo *ifi) dcount = 0; dlen = strlen(resstr_sh_prefix) + strlen(resstr_nl); - gettimeofday(&now, NULL); + clock_gettime(CLOCK_MONOTONIC_FAST, &now); /* * All options from multiple RAs with the same or different @@ -595,7 +595,7 @@ ra_opt_handler(struct ifinfo *ifi) TAILQ_FOREACH(rao, &rai->rai_ra_opt, rao_next) { switch (rao->rao_type) { case ND_OPT_RDNSS: - if (timercmp(&now, &rao->rao_expire, >)) { + if (TS_CMP(&now, &rao->rao_expire, >)) { warnmsg(LOG_INFO, __func__, "expired rdnss entry: %s", (char *)rao->rao_msg); @@ -617,7 +617,7 @@ ra_opt_handler(struct ifinfo *ifi) break; case ND_OPT_DNSSL: - if (timercmp(&now, &rao->rao_expire, >)) { + if (TS_CMP(&now, &rao->rao_expire, >)) { warnmsg(LOG_INFO, __func__, "expired dnssl entry: %s", (char *)rao->rao_msg); |