summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorae <ae@FreeBSD.org>2013-04-16 11:12:58 +0000
committerae <ae@FreeBSD.org>2013-04-16 11:12:58 +0000
commite7b578dd8b76919f0d20ad5eba04df53d774ee3c (patch)
treee4ed86383500f26b037415223abb4205d10cfef7 /sys/netinet6
parent789ce3de65eeebc3388570c1e9a6fbe5daf4a017 (diff)
downloadFreeBSD-src-e7b578dd8b76919f0d20ad5eba04df53d774ee3c.zip
FreeBSD-src-e7b578dd8b76919f0d20ad5eba04df53d774ee3c.tar.gz
Replace hardcoded numbers.
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/ip6_var.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h
index 748efbf..651d0cf 100644
--- a/sys/netinet6/ip6_var.h
+++ b/sys/netinet6/ip6_var.h
@@ -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
OpenPOWER on IntegriCloud