From owner-svn-src-head@FreeBSD.ORG Thu Oct 15 10:31:24 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 BC34A106566B; Thu, 15 Oct 2009 10:31:24 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB9C18FC0C; Thu, 15 Oct 2009 10:31:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9FAVOAZ070666; Thu, 15 Oct 2009 10:31:24 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9FAVOvU070664; Thu, 15 Oct 2009 10:31:24 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910151031.n9FAVOvU070664@svn.freebsd.org> From: Robert Watson Date: Thu, 15 Oct 2009 10:31:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: 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: Thu, 15 Oct 2009 10:31:24 -0000 Author: rwatson Date: Thu Oct 15 10:31:24 2009 New Revision: 198118 URL: http://svn.freebsd.org/changeset/base/198118 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. MFC after: 3 days Modified: head/usr.bin/netstat/route.c Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Thu Oct 15 08:55:43 2009 (r198117) +++ head/usr.bin/netstat/route.c Thu Oct 15 10:31:24 2009 (r198118) @@ -1008,11 +1008,11 @@ rt_stats(u_long rtsaddr, u_long rttaddr) #define p(f, m) if (rtstat.f || sflag <= 1) \ printf(m, rtstat.f, plural(rtstat.f)) - p(rts_badredirect, "\t%u bad routing redirect%s\n"); - p(rts_dynamic, "\t%u dynamically created route%s\n"); - p(rts_newgateway, "\t%u new gateway%s due to redirects\n"); - p(rts_unreach, "\t%u destination%s found unreachable\n"); - p(rts_wildcard, "\t%u use%s of a wildcard route\n"); + p(rts_badredirect, "\t%hu bad routing redirect%s\n"); + p(rts_dynamic, "\t%hu dynamically created route%s\n"); + p(rts_newgateway, "\t%hu new gateway%s due to redirects\n"); + p(rts_unreach, "\t%hu destination%s found unreachable\n"); + p(rts_wildcard, "\t%hu use%s of a wildcard route\n"); #undef p if (rttrash || sflag <= 1)