From owner-svn-src-head@FreeBSD.ORG Fri Oct 16 04:58:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC97F106566C; Fri, 16 Oct 2009 04:58:09 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 5F0CE8FC08; Fri, 16 Oct 2009 04:58:08 +0000 (UTC) Received: from c122-107-125-150.carlnfd1.nsw.optusnet.com.au (c122-107-125-150.carlnfd1.nsw.optusnet.com.au [122.107.125.150]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n9G4w5lc007707 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 16 Oct 2009 15:58:06 +1100 Date: Fri, 16 Oct 2009 15:58:05 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Robert Watson In-Reply-To: <200910151031.n9FAVOvU070664@svn.freebsd.org> Message-ID: <20091016154905.E8438@delplex.bde.org> References: <200910151031.n9FAVOvU070664@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r198118 - head/usr.bin/netstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2009 04:58:10 -0000 On Thu, 15 Oct 2009, Robert Watson wrote: > Log: > Print routing statistics as unsigned short rather than unsigned int, > otherwise sign extension leads to unlikely values when in the negative > range of the signed short structure fields that hold the statistics. > The type used to hold routing statistics is arguably also incorrect. This enlarges the bug. With signed types you get advance warning of overflow (you actually get overflow earlier but it usually just results in obviously wrong values being printed), and repeated warnings on overflow (every time the overflowing values wrap back to negative). With unsigned types or this change, you get unobviously wrong values after the first overflow, and no repeated warnings (unless you watch the values carefully enough to see them go backwards). Using unsigned bytes only delays the overflow for a whole factor of 2. Bruce