summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rtadvd/rrenum.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/rtadvd/rrenum.c')
-rw-r--r--usr.sbin/rtadvd/rrenum.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/rtadvd/rrenum.c b/usr.sbin/rtadvd/rrenum.c
index a8fbbf2..0c97d98 100644
--- a/usr.sbin/rtadvd/rrenum.c
+++ b/usr.sbin/rtadvd/rrenum.c
@@ -49,6 +49,7 @@
#include <netdb.h>
#include <string.h>
#include <stdlib.h>
+#include <time.h>
#include <syslog.h>
#include "rtadvd.h"
#include "rrenum.h"
@@ -215,7 +216,7 @@ do_use_prefix(int len, struct rr_pco_match *rpm,
rai = ifi->ifi_rainfo;
TAILQ_FOREACH(pfx, &rai->rai_prefix, pfx_next) {
- struct timeval now;
+ struct timespec now;
if (prefix_match(&pfx->pfx_prefix,
pfx->pfx_prefixlen, &rpm->rpm_prefix,
@@ -226,14 +227,16 @@ do_use_prefix(int len, struct rr_pco_match *rpm,
pfx->pfx_preflifetime =
ntohl(rpu->rpu_pltime);
if (irr->irr_rrf_decrvalid) {
- gettimeofday(&now, 0);
+ clock_gettime(CLOCK_MONOTONIC_FAST,
+ &now);
pfx->pfx_vltimeexpire =
now.tv_sec +
pfx->pfx_validlifetime;
} else
pfx->pfx_vltimeexpire = 0;
if (irr->irr_rrf_decrprefd) {
- gettimeofday(&now, 0);
+ clock_gettime(CLOCK_MONOTONIC_FAST,
+ &now);
pfx->pfx_pltimeexpire =
now.tv_sec +
pfx->pfx_preflifetime;
OpenPOWER on IntegriCloud