From owner-cvs-all Fri Oct 20 0:57:18 2000 Delivered-To: cvs-all@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id 5C0FE37B4C5; Fri, 20 Oct 2000 00:57:09 -0700 (PDT) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.0/8.11.0) id e9K7v2x27925; Fri, 20 Oct 2000 10:57:02 +0300 (EEST) (envelope-from ru) Date: Fri, 20 Oct 2000 10:57:02 +0300 From: Ruslan Ermilov To: Josef Karthauser Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/netstat if.c src/sys/net if_var.h src/sys/netinet ip_input.c ip_output.c src/sys/netinet6 ip6_input.c ip6_output.c Message-ID: <20001020105702.D14725@sunbay.com> Mail-Followup-To: Josef Karthauser , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org References: <200010192315.QAA62247@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200010192315.QAA62247@freefall.freebsd.org>; from joe@FreeBSD.org on Thu, Oct 19, 2000 at 04:15:55PM -0700 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Oct 19, 2000 at 04:15:55PM -0700, Josef Karthauser wrote: > joe 2000/10/19 16:15:55 PDT > > Modified files: > usr.bin/netstat if.c > sys/net if_var.h > sys/netinet ip_input.c ip_output.c > sys/netinet6 ip6_input.c ip6_output.c > Log: > Augment the 'ifaddr' structure with a 'struct if_data' to keep > statistics on a per network address basis. > > Teach the IPv4 and IPv6 input/output routines to log packets/bytes > against the network address connected to the flow. > > Teach netstat to display the per-address stats for IP protocols > when 'netstat -i' is evoked, instead of displaying the per-interface > stats. > I have some concerns about ip_output(): 1. If compiled with IPSEC, an interface could be changed: [...] } else { /* nobody uses ia beyond here */ ifp = ro->ro_rt->rt_ifp; } [...] The comment "nobody uses ia beyound here" is now incorrect, perhaps we should remove the comment and add the following: ia = ifatoia(ro->ro_rt->rt_ifa); 2. We record statistics before we actually sent the packet through interface, but if_output() may fail. We probably should check the return code from it, and only count on success. 3. Why don't we count the IP fragments? -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message