From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 11:25:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 847ED2E4; Tue, 16 Apr 2013 11:25:46 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 76CD8323; Tue, 16 Apr 2013 11:25:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GBPk2d022192; Tue, 16 Apr 2013 11:25:46 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GBPkAe022191; Tue, 16 Apr 2013 11:25:46 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201304161125.r3GBPkAe022191@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 16 Apr 2013 11:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249545 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 16 Apr 2013 11:25:46 -0000 Author: ae Date: Tue Apr 16 11:25:45 2013 New Revision: 249545 URL: http://svnweb.freebsd.org/changeset/base/249545 Log: Replace hardcoded numbers. Also use interface-local scope name instead of node-local. Modified: head/usr.bin/netstat/inet6.c Modified: head/usr.bin/netstat/inet6.c ============================================================================== --- head/usr.bin/netstat/inet6.c Tue Apr 16 11:19:13 2013 (r249544) +++ head/usr.bin/netstat/inet6.c Tue Apr 16 11:25:45 2013 (r249545) @@ -408,7 +408,7 @@ ip6_stats(u_long off, const char *name, p(ip6s_cantfrag, "\t%ju datagram%s that can't be fragmented\n"); p(ip6s_badscope, "\t%ju packet%s that violated scope rules\n"); p(ip6s_notmember, "\t%ju multicast packet%s which we don't join\n"); - for (first = 1, i = 0; i < 256; i++) + for (first = 1, i = 0; i < IP6S_HDRCNT; i++) if (ip6stat.ip6s_nxthist[i] != 0) { if (first) { printf("\tInput histogram:\n"); @@ -419,7 +419,7 @@ ip6_stats(u_long off, const char *name, } printf("\tMbuf statistics:\n"); printf("\t\t%ju one mbuf\n", (uintmax_t)ip6stat.ip6s_m1); - for (first = 1, i = 0; i < 32; i++) { + for (first = 1, i = 0; i < IP6S_M2MMAX; i++) { char ifbuf[IFNAMSIZ]; if (ip6stat.ip6s_m2m[i] != 0) { if (first) { @@ -445,7 +445,7 @@ ip6_stats(u_long off, const char *name, #define PRINT_SCOPESTAT(s,i) do {\ switch(i) { /* XXX hardcoding in each case */\ case 1:\ - p(s, "\t\t%ju node-local%s\n");\ + p(s, "\t\t%ju interface-local%s\n");\ break;\ case 2:\ p(s,"\t\t%ju link-local%s\n");\ @@ -464,7 +464,7 @@ ip6_stats(u_long off, const char *name, p(ip6s_sources_none, "\t%ju failure%s of source address selection\n"); - for (first = 1, i = 0; i < 16; i++) { + for (first = 1, i = 0; i < IP6S_SCOPECNT; i++) { if (ip6stat.ip6s_sources_sameif[i]) { if (first) { printf("\tsource addresses on an outgoing I/F\n"); @@ -473,7 +473,7 @@ ip6_stats(u_long off, const char *name, PRINT_SCOPESTAT(ip6s_sources_sameif[i], i); } } - for (first = 1, i = 0; i < 16; i++) { + for (first = 1, i = 0; i < IP6S_SCOPECNT; i++) { if (ip6stat.ip6s_sources_otherif[i]) { if (first) { printf("\tsource addresses on a non-outgoing I/F\n"); @@ -482,7 +482,7 @@ ip6_stats(u_long off, const char *name, PRINT_SCOPESTAT(ip6s_sources_otherif[i], i); } } - for (first = 1, i = 0; i < 16; i++) { + for (first = 1, i = 0; i < IP6S_SCOPECNT; i++) { if (ip6stat.ip6s_sources_samescope[i]) { if (first) { printf("\tsource addresses of same scope\n"); @@ -491,7 +491,7 @@ ip6_stats(u_long off, const char *name, PRINT_SCOPESTAT(ip6s_sources_samescope[i], i); } } - for (first = 1, i = 0; i < 16; i++) { + for (first = 1, i = 0; i < IP6S_SCOPECNT; i++) { if (ip6stat.ip6s_sources_otherscope[i]) { if (first) { printf("\tsource addresses of a different scope\n"); @@ -500,7 +500,7 @@ ip6_stats(u_long off, const char *name, PRINT_SCOPESTAT(ip6s_sources_otherscope[i], i); } } - for (first = 1, i = 0; i < 16; i++) { + for (first = 1, i = 0; i < IP6S_SCOPECNT; i++) { if (ip6stat.ip6s_sources_deprecated[i]) { if (first) { printf("\tdeprecated source addresses\n"); @@ -511,7 +511,7 @@ ip6_stats(u_long off, const char *name, } printf("\tSource addresses selection rule applied:\n"); - for (i = 0; i < 16; i++) { + for (i = 0; i < IP6S_RULESMAX; i++) { if (ip6stat.ip6s_sources_rule[i]) printf("\t\t%ju %s\n", (uintmax_t)ip6stat.ip6s_sources_rule[i],