Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Dec 2010 09:37:56 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r216225 - head/usr.sbin/rarpd
Message-ID:  <201012060937.oB69buhP027591@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Mon Dec  6 09:37:56 2010
New Revision: 216225
URL: http://svn.freebsd.org/changeset/base/216225

Log:
  Catch up with kernel using time_uptime to drive ARP timeouts.
  
  Noticed by:	jilles

Modified:
  head/usr.sbin/rarpd/rarpd.c

Modified: head/usr.sbin/rarpd/rarpd.c
==============================================================================
--- head/usr.sbin/rarpd/rarpd.c	Mon Dec  6 09:18:11 2010	(r216224)
+++ head/usr.sbin/rarpd/rarpd.c	Mon Dec  6 09:37:56 2010	(r216225)
@@ -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 ipad
 	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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012060937.oB69buhP027591>