diff options
author | glebius <glebius@FreeBSD.org> | 2010-11-30 15:57:00 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2010-11-30 15:57:00 +0000 |
commit | bdd7d886f9757dc70bd9cac6002e46fab564d587 (patch) | |
tree | 8517ada49ac20c31d7eac89a89b485be46414507 /usr.sbin/arp | |
parent | 5b6b615a821bda72e166a8931463117f5f288973 (diff) | |
download | FreeBSD-src-bdd7d886f9757dc70bd9cac6002e46fab564d587.zip FreeBSD-src-bdd7d886f9757dc70bd9cac6002e46fab564d587.tar.gz |
Use time_uptime instead of non-monotonic time_second to drive ARP
timeouts.
Suggested by: bde
Diffstat (limited to 'usr.sbin/arp')
-rw-r--r-- | usr.sbin/arp/arp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/arp/arp.c b/usr.sbin/arp/arp.c index 2ee9d67..32bfd9a 100644 --- a/usr.sbin/arp/arp.c +++ b/usr.sbin/arp/arp.c @@ -602,10 +602,10 @@ print_entry(struct sockaddr_dl *sdl, if (rtm->rtm_rmx.rmx_expire == 0) printf(" permanent"); else { - static struct timeval tv; - if (tv.tv_sec == 0) - gettimeofday(&tv, 0); - if ((expire_time = rtm->rtm_rmx.rmx_expire - tv.tv_sec) > 0) + static struct timespec tp; + if (tp.tv_sec == 0) + clock_gettime(CLOCK_MONOTONIC, &tp); + if ((expire_time = rtm->rtm_rmx.rmx_expire - tp.tv_sec) > 0) printf(" expires in %d seconds", (int)expire_time); else printf(" expired"); |