From owner-freebsd-stable@FreeBSD.ORG Tue Jan 26 16:49:10 2010 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D84DE1065672 for ; Tue, 26 Jan 2010 16:49:10 +0000 (UTC) (envelope-from ncrogers@gmail.com) Received: from mail-px0-f183.google.com (mail-px0-f183.google.com [209.85.216.183]) by mx1.freebsd.org (Postfix) with ESMTP id AE2078FC17 for ; Tue, 26 Jan 2010 16:49:10 +0000 (UTC) Received: by pxi13 with SMTP id 13so3305950pxi.3 for ; Tue, 26 Jan 2010 08:49:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=TAy30rM53wiJ6Cthv5RNg5QV24BSG5auB7sDqbgWEpE=; b=APnYl6skaK9bCtR7/0gDQHCKPFPtY7V1S62l5HhiJuXYom4QHjha4WxTRA6fLAimQA 02hZO912PkPU72O9yAIs/JLWaPy49NyNJUTBVp0t3VlJUICUR3ShQvC2ldmdDHLPW1of J1d6WUD54dlccopfnkx/eAu6kZWoBlhbVNlEU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=sE4TH710a8Ipbjan+ZqRbXIhfrIBx53SvSromQmOktYCyLCOHTdVjyBOndJWWU95HJ SSJSkcFvbJbhgFMjAe6BOqY8pFkoz23clSLtW0S1vQqWIGMIxa4J0ZQLe/hM8VRTQHnn ssMEQNqzR74O9iB2kpHtPSfk+DKJp3B3YjyRk= MIME-Version: 1.0 Received: by 10.142.67.41 with SMTP id p41mr1490489wfa.284.1264524549891; Tue, 26 Jan 2010 08:49:09 -0800 (PST) In-Reply-To: <20100126124154.GA72180@edoofus.dev.vega.ru> References: <147432021001251901u7d56f014n83e834061fd09fec@mail.gmail.com> <20100126124154.GA72180@edoofus.dev.vega.ru> Date: Tue, 26 Jan 2010 08:49:09 -0800 Message-ID: <147432021001260849l7c2e1175gdee26b44fc1191ba@mail.gmail.com> From: Nick Rogers To: Ruslan Ermilov Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: stable@freebsd.org Subject: Re: netstat output changes in 8.0? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2010 16:49:11 -0000 Thanks a lot. Thats a bummer. What are the chances of getting something like that worked into arp(8) permanently? On Tue, Jan 26, 2010 at 4:41 AM, Ruslan Ermilov wrote: > On Mon, Jan 25, 2010 at 07:01:46PM -0800, Nick Rogers wrote: > > Before 8.0-RELEASE, if I ran netstat -rn, it listed a separate route for > > each host on the network, along with its MAC address. For example ... > > > > 172.20.172.17 00:02:b3:2f:64:6a UHLW 1 105712 1500 > > vlan172 595 > > 172.20.172.20 00:1e:c9:bb:7c:a9 UHLW 1 1002 1500 > > vlan172 598 > > 172.20.172.22 00:14:5e:16:bb:b6 UHLW 1 107 1500 > > vlan172 491 > > > > This behavior seems to have changed in 8.0, where now only the > > locally-assigned IP addresses and related CIDRs are displayed. > > From src/UPDATING: > > : 20081214: > : __FreeBSD_version 800059 incorporates the new arp-v2 rewrite. > : RTF_CLONING, RTF_LLINFO and RTF_WASCLONED flags are eliminated. > : The new code reduced struct rtentry{} by 16 bytes on 32-bit > : architecture and 40 bytes on 64-bit architecture. The userland > : applications "arp" and "ndp" have been updated accordingly. > : The output from "netstat -r" shows only routing entries and > : none of the L2 information. > > > Is there any way to get this behavior back, perhaps with a new flag that > I > > am not able to find? Or some sysctl? I have a script that was relying on > > each host's "expire" flag in the routing table to determine when the MAC > > address first appeared on the network according to ARP. > > If you need to know when a particular ARP entry expires, a variation > of the following patch can be used, perhaps hiding this output by the > -v (verbose) option. > > %%% > Index: arp.c > =================================================================== > --- arp.c (revision 203016) > +++ arp.c (working copy) > @@ -101,7 +101,8 @@ > static int nflag; /* no reverse dns lookups */ > static char *rifname; > > -static int expire_time, flags, doing_proxy, proxy_only; > +static time_t expire_time; > +static int flags, doing_proxy, proxy_only; > > /* which function we're supposed to do */ > #define F_GET 1 > @@ -594,6 +595,15 @@ > printf(" on %s", ifname); > 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) > + printf(" expires %d", (int)expire_time); > + else > + printf(" expired"); > + } > if (addr->sin_other & SIN_PROXY) > printf(" published (proxy only)"); > if (rtm->rtm_flags & RTF_ANNOUNCE) > %%% > > > Cheers, > -- > Ruslan Ermilov > ru@FreeBSD.org > FreeBSD committer >