aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/rarpd
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2010-12-06 09:37:56 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2010-12-06 09:37:56 +0000
commit441238cfdc25f4a72c8b33a427183aac1a4f7918 (patch)
treeed3a4bd8b6165674155f0c41454cfe2c17d3ebd6 /usr.sbin/rarpd
parentcdfc719c2e8b20c0841b8dcb7af77e2c24c5610a (diff)
downloadsrc-441238cfdc25f4a72c8b33a427183aac1a4f7918.tar.gz
src-441238cfdc25f4a72c8b33a427183aac1a4f7918.zip
Catch up with kernel using time_uptime to drive ARP timeouts.
Noticed by: jilles
Notes
Notes: svn path=/head/; revision=216225
Diffstat (limited to 'usr.sbin/rarpd')
-rw-r--r--usr.sbin/rarpd/rarpd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/rarpd/rarpd.c b/usr.sbin/rarpd/rarpd.c
index a500dd512a13..66055f395e29 100644
--- a/usr.sbin/rarpd/rarpd.c
+++ b/usr.sbin/rarpd/rarpd.c
@@ -666,6 +666,7 @@ struct {
static void
update_arptab(u_char *ep, in_addr_t ipaddr)
{
+ struct timespec tp;
int cc;
struct sockaddr_inarp *ar, *ar2;
struct sockaddr_dl *ll, *ll2;
@@ -731,7 +732,8 @@ update_arptab(u_char *ep, in_addr_t ipaddr)
rt->rtm_version = RTM_VERSION;
rt->rtm_addrs = RTA_DST | RTA_GATEWAY;
rt->rtm_inits = RTV_EXPIRE;
- rt->rtm_rmx.rmx_expire = time(0) + ARPSECS;
+ clock_gettime(CLOCK_MONOTONIC, &tp);
+ rt->rtm_rmx.rmx_expire = tp.tv_sec + ARPSECS;
rt->rtm_flags = RTF_HOST | RTF_STATIC;
rt->rtm_type = RTM_ADD;
rt->rtm_seq = ++seq;