From owner-svn-src-head@FreeBSD.ORG Tue Apr 16 11:12:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 612DFABE; Tue, 16 Apr 2013 11:12:59 +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 39C44259; Tue, 16 Apr 2013 11:12:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GBCxG9018726; Tue, 16 Apr 2013 11:12:59 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GBCx2n018725; Tue, 16 Apr 2013 11:12:59 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201304161112.r3GBCx2n018725@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 16 Apr 2013 11:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249543 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 16 Apr 2013 11:12:59 -0000 Author: ae Date: Tue Apr 16 11:12:58 2013 New Revision: 249543 URL: http://svnweb.freebsd.org/changeset/base/249543 Log: Replace hardcoded numbers. Modified: head/sys/netinet6/ip6_var.h Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Tue Apr 16 08:54:50 2013 (r249542) +++ head/sys/netinet6/ip6_var.h Tue Apr 16 11:12:58 2013 (r249543) @@ -204,9 +204,11 @@ struct ip6stat { u_quad_t ip6s_rawout; /* total raw ip packets generated */ u_quad_t ip6s_badscope; /* scope error */ u_quad_t ip6s_notmember; /* don't join this multicast group */ - u_quad_t ip6s_nxthist[256]; /* next header history */ +#define IP6S_HDRCNT 256 /* headers count */ + u_quad_t ip6s_nxthist[IP6S_HDRCNT]; /* next header history */ u_quad_t ip6s_m1; /* one mbuf */ - u_quad_t ip6s_m2m[32]; /* two or more mbuf */ +#define IP6S_M2MMAX 32 + u_quad_t ip6s_m2m[IP6S_M2MMAX]; /* two or more mbuf */ u_quad_t ip6s_mext1; /* one ext mbuf */ u_quad_t ip6s_mext2m; /* two or more ext mbuf */ u_quad_t ip6s_exthdrtoolong; /* ext hdr are not contiguous */ @@ -218,27 +220,29 @@ struct ip6stat { * algorithm: * XXX: hardcoded 16 = # of ip6 multicast scope types + 1 */ +#define IP6S_RULESMAX 16 +#define IP6S_SCOPECNT 16 /* number of times that address selection fails */ u_quad_t ip6s_sources_none; /* number of times that an address on the outgoing I/F is chosen */ - u_quad_t ip6s_sources_sameif[16]; + u_quad_t ip6s_sources_sameif[IP6S_SCOPECNT]; /* number of times that an address on a non-outgoing I/F is chosen */ - u_quad_t ip6s_sources_otherif[16]; + u_quad_t ip6s_sources_otherif[IP6S_SCOPECNT]; /* * number of times that an address that has the same scope * from the destination is chosen. */ - u_quad_t ip6s_sources_samescope[16]; + u_quad_t ip6s_sources_samescope[IP6S_SCOPECNT]; /* * number of times that an address that has a different scope * from the destination is chosen. */ - u_quad_t ip6s_sources_otherscope[16]; + u_quad_t ip6s_sources_otherscope[IP6S_SCOPECNT]; /* number of times that a deprecated address is chosen */ - u_quad_t ip6s_sources_deprecated[16]; + u_quad_t ip6s_sources_deprecated[IP6S_SCOPECNT]; /* number of times that each rule of source selection is applied. */ - u_quad_t ip6s_sources_rule[16]; + u_quad_t ip6s_sources_rule[IP6S_MAXRULES]; }; #ifdef _KERNEL