From owner-svn-src-all@FreeBSD.ORG Tue Nov 30 22:27:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22C7D1065693; Tue, 30 Nov 2010 22:27:55 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id B01CB8FC0C; Tue, 30 Nov 2010 22:27:54 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id ADB021DD79C; Tue, 30 Nov 2010 23:27:53 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id 95169170CB; Tue, 30 Nov 2010 23:27:53 +0100 (CET) Date: Tue, 30 Nov 2010 23:27:53 +0100 From: Jilles Tjoelker To: Gleb Smirnoff Message-ID: <20101130222753.GA93292@stack.nl> References: <201011301557.oAUFv0TC007320@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201011301557.oAUFv0TC007320@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216075 - in head: sys/netinet usr.sbin/arp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2010 22:27:55 -0000 On Tue, Nov 30, 2010 at 03:57:00PM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Tue Nov 30 15:57:00 2010 > New Revision: 216075 > URL: http://svn.freebsd.org/changeset/base/216075 > Log: > Use time_uptime instead of non-monotonic time_second to drive ARP > timeouts. > Suggested by: bde > Modified: > head/sys/netinet/if_ether.c > head/sys/netinet/in.c > head/usr.sbin/arp/arp.c > Modified: head/usr.sbin/arp/arp.c > ============================================================================== > --- head/usr.sbin/arp/arp.c Tue Nov 30 09:34:47 2010 (r216074) > +++ head/usr.sbin/arp/arp.c Tue Nov 30 15:57:00 2010 (r216075) > @@ -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"); Hmm, doesn't this break the API between arp(8) and the kernel? Assuming we care, perhaps arp(8) should send/receive realtime, converted at the time it requests the data. The kernel can then continue to use monotonic time internally (which I agree is better). -- Jilles Tjoelker