Author: rwatson
Date: Sun Apr 12 13:22:33 2009
New Revision: 190964
URL: http://svn.freebsd.org/changeset/base/190964

Log:
  Update stats in struct icmpstat and icmp6stat using four new
  macros: ICMPSTAT_ADD(), ICMPSTAT_INC(), ICMP6STAT_ADD(), and
  ICMP6STAT_INC(), rather than directly manipulating the fields
  of these structures across the kernel.  This will make it
  easier to change the implementation of these statistics,
  such as using per-CPU versions of the data structures.
  
  In on case, icmp6stat members are manipulated indirectly, by
  icmp6_errcount(), and this will require further work to fix
  for per-CPU stats.
  
  MFC after:    3 days

Modified:
  head/sys/contrib/pf/net/pf.c
  head/sys/netinet/icmp6.h
  head/sys/netinet/icmp_var.h
  head/sys/netinet/ip_icmp.c
  head/sys/netinet6/icmp6.c
  head/sys/netinet6/mld6.c
  head/sys/netinet6/nd6.c
  head/sys/netinet6/nd6_nbr.c
  head/sys/netinet6/nd6_rtr.c
  head/sys/netinet6/raw_ip6.c

Modified: head/sys/contrib/pf/net/pf.c
==============================================================================
--- head/sys/contrib/pf/net/pf.c        Sun Apr 12 11:53:12 2009        
(r190963)
+++ head/sys/contrib/pf/net/pf.c        Sun Apr 12 13:22:33 2009        
(r190964)
@@ -6647,14 +6647,14 @@ pf_check_proto_cksum(struct mbuf *m, int
                case IPPROTO_ICMP:
                    {
                        INIT_VNET_INET(curvnet);
-                       V_icmpstat.icps_checksum++;
+                       ICMPSTAT_INC(icps_checksum);
                        break;
                    }
 #ifdef INET6
                case IPPROTO_ICMPV6:
                    {
                        INIT_VNET_INET6(curvnet);
-                       V_icmp6stat.icp6s_checksum++;
+                       ICMP6STAT_INC(icp6s_checksum);
                        break;
                    }
 #endif /* INET6 */
@@ -6747,11 +6747,11 @@ pf_check_proto_cksum(struct mbuf *m, int
                        UDPSTAT_INC(udps_badsum);
                        break;
                case IPPROTO_ICMP:
-                       V_icmpstat.icps_checksum++;
+                       ICMPSTAT_INC(icps_checksum);
                        break;
 #ifdef INET6
                case IPPROTO_ICMPV6:
-                       V_icmp6stat.icp6s_checksum++;
+                       ICMP6STAT_INC(icp6s_checksum);
                        break;
 #endif /* INET6 */
                }

Modified: head/sys/netinet/icmp6.h
==============================================================================
--- head/sys/netinet/icmp6.h    Sun Apr 12 11:53:12 2009        (r190963)
+++ head/sys/netinet/icmp6.h    Sun Apr 12 13:22:33 2009        (r190964)
@@ -596,6 +596,11 @@ struct icmp6stat {
        u_quad_t icp6s_badredirect;     /* bad redirect message */
 };
 
+#ifdef _KERNEL
+#define        ICMP6STAT_ADD(name, val)        V_icmp6stat.name += (val)
+#define        ICMP6STAT_INC(name)             ICMP6STAT_ADD(name, 1)
+#endif
+
 /*
  * Names for ICMP sysctl objects
  */

Modified: head/sys/netinet/icmp_var.h
==============================================================================
--- head/sys/netinet/icmp_var.h Sun Apr 12 11:53:12 2009        (r190963)
+++ head/sys/netinet/icmp_var.h Sun Apr 12 13:22:33 2009        (r190964)
@@ -57,6 +57,11 @@ struct       icmpstat {
        u_long  icps_noroute;           /* no route back */
 };
 
+#ifdef _KERNEL
+#define        ICMPSTAT_ADD(name, val) V_icmpstat.name += (val)
+#define        ICMPSTAT_INC(name)      ICMPSTAT_ADD(name, 1)
+#endif
+
 /*
  * Names for ICMP sysctl objects
  */

Modified: head/sys/netinet/ip_icmp.c
==============================================================================
--- head/sys/netinet/ip_icmp.c  Sun Apr 12 11:53:12 2009        (r190963)
+++ head/sys/netinet/ip_icmp.c  Sun Apr 12 13:22:33 2009        (r190964)
@@ -180,7 +180,7 @@ icmp_error(struct mbuf *n, int type, int
                printf("icmp_error(%p, %x, %d)\n", oip, type, code);
 #endif
        if (type != ICMP_REDIRECT)
-               V_icmpstat.icps_error++;
+               ICMPSTAT_INC(icps_error);
        /*
         * Don't send error:
         *  if the original packet was encrypted.
@@ -197,7 +197,7 @@ icmp_error(struct mbuf *n, int type, int
        if (oip->ip_p == IPPROTO_ICMP && type != ICMP_REDIRECT &&
          n->m_len >= oiphlen + ICMP_MINLEN &&
          !ICMP_INFOTYPE(((struct icmp *)((caddr_t)oip + oiphlen))->icmp_type)) 
{
-               V_icmpstat.icps_oldicmp++;
+               ICMPSTAT_INC(icps_oldicmp);
                goto freeit;
        }
        /* Drop if IP header plus 8 bytes is not contignous in first mbuf. */
@@ -257,7 +257,7 @@ stdreply:   icmpelen = max(8, min(V_icmp_q
         */
        M_SETFIB(m, M_GETFIB(n));
        icp = mtod(m, struct icmp *);
-       V_icmpstat.icps_outhist[type]++;
+       ICMPSTAT_INC(icps_outhist[type]);
        icp->icmp_type = type;
        if (type == ICMP_REDIRECT)
                icp->icmp_gwaddr.s_addr = dest;
@@ -340,12 +340,12 @@ icmp_input(struct mbuf *m, int off)
        }
 #endif
        if (icmplen < ICMP_MINLEN) {
-               V_icmpstat.icps_tooshort++;
+               ICMPSTAT_INC(icps_tooshort);
                goto freeit;
        }
        i = hlen + min(icmplen, ICMP_ADVLENMIN);
        if (m->m_len < i && (m = m_pullup(m, i)) == 0)  {
-               V_icmpstat.icps_tooshort++;
+               ICMPSTAT_INC(icps_tooshort);
                return;
        }
        ip = mtod(m, struct ip *);
@@ -353,7 +353,7 @@ icmp_input(struct mbuf *m, int off)
        m->m_data += hlen;
        icp = mtod(m, struct icmp *);
        if (in_cksum(m, icmplen)) {
-               V_icmpstat.icps_checksum++;
+               ICMPSTAT_INC(icps_checksum);
                goto freeit;
        }
        m->m_len += hlen;
@@ -395,7 +395,7 @@ icmp_input(struct mbuf *m, int off)
        icmpgw.sin_len = sizeof(struct sockaddr_in);
        icmpgw.sin_family = AF_INET;
 
-       V_icmpstat.icps_inhist[icp->icmp_type]++;
+       ICMPSTAT_INC(icps_inhist[icp->icmp_type]);
        code = icp->icmp_code;
        switch (icp->icmp_type) {
 
@@ -460,7 +460,7 @@ icmp_input(struct mbuf *m, int off)
                 */
                if (icmplen < ICMP_ADVLENMIN || icmplen < ICMP_ADVLEN(icp) ||
                    icp->icmp_ip.ip_hl < (sizeof(struct ip) >> 2)) {
-                       V_icmpstat.icps_badlen++;
+                       ICMPSTAT_INC(icps_badlen);
                        goto freeit;
                }
                icp->icmp_ip.ip_len = ntohs(icp->icmp_ip.ip_len);
@@ -483,13 +483,13 @@ icmp_input(struct mbuf *m, int off)
                break;
 
        badcode:
-               V_icmpstat.icps_badcode++;
+               ICMPSTAT_INC(icps_badcode);
                break;
 
        case ICMP_ECHO:
                if (!V_icmpbmcastecho
                    && (m->m_flags & (M_MCAST | M_BCAST)) != 0) {
-                       V_icmpstat.icps_bmcastecho++;
+                       ICMPSTAT_INC(icps_bmcastecho);
                        break;
                }
                icp->icmp_type = ICMP_ECHOREPLY;
@@ -501,11 +501,11 @@ icmp_input(struct mbuf *m, int off)
        case ICMP_TSTAMP:
                if (!V_icmpbmcastecho
                    && (m->m_flags & (M_MCAST | M_BCAST)) != 0) {
-                       V_icmpstat.icps_bmcasttstamp++;
+                       ICMPSTAT_INC(icps_bmcasttstamp);
                        break;
                }
                if (icmplen < ICMP_TSLEN) {
-                       V_icmpstat.icps_badlen++;
+                       ICMPSTAT_INC(icps_badlen);
                        break;
                }
                icp->icmp_type = ICMP_TSTAMPREPLY;
@@ -554,8 +554,8 @@ icmp_input(struct mbuf *m, int off)
                }
 reflect:
                ip->ip_len += hlen;     /* since ip_input deducts this */
-               V_icmpstat.icps_reflect++;
-               V_icmpstat.icps_outhist[icp->icmp_type]++;
+               ICMPSTAT_INC(icps_reflect);
+               ICMPSTAT_INC(icps_outhist[icp->icmp_type]);
                icmp_reflect(m);
                return;
 
@@ -585,7 +585,7 @@ reflect:
                        goto badcode;
                if (icmplen < ICMP_ADVLENMIN || icmplen < ICMP_ADVLEN(icp) ||
                    icp->icmp_ip.ip_hl < (sizeof(struct ip) >> 2)) {
-                       V_icmpstat.icps_badlen++;
+                       ICMPSTAT_INC(icps_badlen);
                        break;
                }
                /*
@@ -660,7 +660,7 @@ icmp_reflect(struct mbuf *m)
            IN_EXPERIMENTAL(ntohl(ip->ip_src.s_addr)) ||
            IN_ZERONET(ntohl(ip->ip_src.s_addr)) ) {
                m_freem(m);     /* Bad return address */
-               V_icmpstat.icps_badaddr++;
+               ICMPSTAT_INC(icps_badaddr);
                goto done;      /* Ip_output() will check for broadcast */
        }
 
@@ -729,7 +729,7 @@ icmp_reflect(struct mbuf *m)
        ia = ip_rtaddr(ip->ip_dst, M_GETFIB(m));
        if (ia == NULL) {
                m_freem(m);
-               V_icmpstat.icps_noroute++;
+               ICMPSTAT_INC(icps_noroute);
                goto done;
        }
 match:

Modified: head/sys/netinet6/icmp6.c
==============================================================================
--- head/sys/netinet6/icmp6.c   Sun Apr 12 11:53:12 2009        (r190963)
+++ head/sys/netinet6/icmp6.c   Sun Apr 12 13:22:33 2009        (r190964)
@@ -254,14 +254,14 @@ icmp6_error(struct mbuf *m, int type, in
        int off;
        int nxt;
 
-       V_icmp6stat.icp6s_error++;
+       ICMP6STAT_INC(icp6s_error);
 
        /* count per-type-code statistics */
        icmp6_errcount(&V_icmp6stat.icp6s_outerrhist, type, code);
 
 #ifdef M_DECRYPTED     /*not openbsd*/
        if (m->m_flags & M_DECRYPTED) {
-               V_icmp6stat.icp6s_canterror++;
+               ICMP6STAT_INC(icp6s_canterror);
                goto freeit;
        }
 #endif
@@ -319,7 +319,7 @@ icmp6_error(struct mbuf *m, int type, in
                IP6_EXTHDR_GET(icp, struct icmp6_hdr *, m, off,
                        sizeof(*icp));
                if (icp == NULL) {
-                       V_icmp6stat.icp6s_tooshort++;
+                       ICMP6STAT_INC(icp6s_tooshort);
                        return;
                }
 #endif
@@ -330,7 +330,7 @@ icmp6_error(struct mbuf *m, int type, in
                         * Special case: for redirect (which is
                         * informational) we must not send icmp6 error.
                         */
-                       V_icmp6stat.icp6s_canterror++;
+                       ICMP6STAT_INC(icp6s_canterror);
                        goto freeit;
                } else {
                        /* ICMPv6 informational - send the error */
@@ -343,7 +343,7 @@ icmp6_error(struct mbuf *m, int type, in
 
        /* Finally, do rate limitation check. */
        if (icmp6_ratelimit(&oip6->ip6_src, type, code)) {
-               V_icmp6stat.icp6s_toofreq++;
+               ICMP6STAT_INC(icp6s_toofreq);
                goto freeit;
        }
 
@@ -384,7 +384,7 @@ icmp6_error(struct mbuf *m, int type, in
         */
        m->m_pkthdr.rcvif = NULL;
 
-       V_icmp6stat.icp6s_outhist[type]++;
+       ICMP6STAT_INC(icp6s_outhist[type]);
        icmp6_reflect(m, sizeof(struct ip6_hdr)); /* header order: IPv6 - 
ICMPv6 */
 
        return;
@@ -424,7 +424,7 @@ icmp6_input(struct mbuf **mp, int *offp,
 
        ip6 = mtod(m, struct ip6_hdr *);
        if (icmp6len < sizeof(struct icmp6_hdr)) {
-               V_icmp6stat.icp6s_tooshort++;
+               ICMP6STAT_INC(icp6s_tooshort);
                goto freeit;
        }
 
@@ -436,7 +436,7 @@ icmp6_input(struct mbuf **mp, int *offp,
 #else
        IP6_EXTHDR_GET(icmp6, struct icmp6_hdr *, m, off, sizeof(*icmp6));
        if (icmp6 == NULL) {
-               V_icmp6stat.icp6s_tooshort++;
+               ICMP6STAT_INC(icp6s_tooshort);
                return IPPROTO_DONE;
        }
 #endif
@@ -447,7 +447,7 @@ icmp6_input(struct mbuf **mp, int *offp,
                    "ICMP6 checksum error(%d|%x) %s\n",
                    icmp6->icmp6_type, sum,
                    ip6_sprintf(ip6bufs, &ip6->ip6_src)));
-               V_icmp6stat.icp6s_checksum++;
+               ICMP6STAT_INC(icp6s_checksum);
                goto freeit;
        }
 
@@ -467,7 +467,7 @@ icmp6_input(struct mbuf **mp, int *offp,
                }
        }
 
-       V_icmp6stat.icp6s_inhist[icmp6->icmp6_type]++;
+       ICMP6STAT_INC(icp6s_inhist[icmp6->icmp6_type]);
        icmp6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_msg);
        if (icmp6->icmp6_type < ICMP6_INFOMSG_MASK)
                icmp6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_error);
@@ -601,8 +601,8 @@ icmp6_input(struct mbuf **mp, int *offp,
                nicmp6->icmp6_type = ICMP6_ECHO_REPLY;
                nicmp6->icmp6_code = 0;
                if (n) {
-                       V_icmp6stat.icp6s_reflect++;
-                       V_icmp6stat.icp6s_outhist[ICMP6_ECHO_REPLY]++;
+                       ICMP6STAT_INC(icp6s_reflect);
+                       ICMP6STAT_INC(icp6s_outhist[ICMP6_ECHO_REPLY]);
                        icmp6_reflect(n, noff);
                }
                break;
@@ -734,8 +734,8 @@ icmp6_input(struct mbuf **mp, int *offp,
                }
 #undef hostnamelen
                if (n) {
-                       V_icmp6stat.icp6s_reflect++;
-                       V_icmp6stat.icp6s_outhist[ICMP6_WRUREPLY]++;
+                       ICMP6STAT_INC(icp6s_reflect);
+                       ICMP6STAT_INC(icp6s_outhist[ICMP6_WRUREPLY]);
                        icmp6_reflect(n, noff);
                }
                break;
@@ -856,11 +856,11 @@ icmp6_input(struct mbuf **mp, int *offp,
                break;
 
        badcode:
-               V_icmp6stat.icp6s_badcode++;
+               ICMP6STAT_INC(icp6s_badcode);
                break;
 
        badlen:
-               V_icmp6stat.icp6s_badlen++;
+               ICMP6STAT_INC(icp6s_badlen);
                break;
        }
 
@@ -885,7 +885,7 @@ icmp6_notify_error(struct mbuf **mp, int
        struct sockaddr_in6 icmp6src, icmp6dst;
 
        if (icmp6len < sizeof(struct icmp6_hdr) + sizeof(struct ip6_hdr)) {
-               V_icmp6stat.icp6s_tooshort++;
+               ICMP6STAT_INC(icp6s_tooshort);
                goto freeit;
        }
 #ifndef PULLDOWN_TEST
@@ -896,7 +896,7 @@ icmp6_notify_error(struct mbuf **mp, int
        IP6_EXTHDR_GET(icmp6, struct icmp6_hdr *, m, off,
            sizeof(*icmp6) + sizeof(struct ip6_hdr));
        if (icmp6 == NULL) {
-               V_icmp6stat.icp6s_tooshort++;
+               ICMP6STAT_INC(icp6s_tooshort);
                return (-1);
        }
 #endif
@@ -931,7 +931,7 @@ icmp6_notify_error(struct mbuf **mp, int
                                IP6_EXTHDR_GET(eh, struct ip6_ext *, m,
                                    eoff, sizeof(*eh));
                                if (eh == NULL) {
-                                       V_icmp6stat.icp6s_tooshort++;
+                                       ICMP6STAT_INC(icp6s_tooshort);
                                        return (-1);
                                }
 #endif
@@ -959,7 +959,7 @@ icmp6_notify_error(struct mbuf **mp, int
                                IP6_EXTHDR_GET(rth, struct ip6_rthdr *, m,
                                    eoff, sizeof(*rth));
                                if (rth == NULL) {
-                                       V_icmp6stat.icp6s_tooshort++;
+                                       ICMP6STAT_INC(icp6s_tooshort);
                                        return (-1);
                                }
 #endif
@@ -985,7 +985,7 @@ icmp6_notify_error(struct mbuf **mp, int
                                            struct ip6_rthdr0 *, m,
                                            eoff, rthlen);
                                        if (rth0 == NULL) {
-                                               V_icmp6stat.icp6s_tooshort++;
+                                               ICMP6STAT_INC(icp6s_tooshort);
                                                return (-1);
                                        }
 #endif
@@ -1007,7 +1007,7 @@ icmp6_notify_error(struct mbuf **mp, int
                                IP6_EXTHDR_GET(fh, struct ip6_frag *, m,
                                    eoff, sizeof(*fh));
                                if (fh == NULL) {
-                                       V_icmp6stat.icp6s_tooshort++;
+                                       ICMP6STAT_INC(icp6s_tooshort);
                                        return (-1);
                                }
 #endif
@@ -1042,7 +1042,7 @@ icmp6_notify_error(struct mbuf **mp, int
                IP6_EXTHDR_GET(icmp6, struct icmp6_hdr *, m, off,
                    sizeof(*icmp6) + sizeof(struct ip6_hdr));
                if (icmp6 == NULL) {
-                       V_icmp6stat.icp6s_tooshort++;
+                       ICMP6STAT_INC(icp6s_tooshort);
                        return (-1);
                }
 #endif
@@ -1156,7 +1156,7 @@ icmp6_mtudisc_update(struct ip6ctlparam 
 
        if (mtu < tcp_maxmtu6(&inc, NULL)) {
                tcp_hc_updatemtu(&inc, mtu);
-               V_icmp6stat.icp6s_pmtuchg++;
+               ICMP6STAT_INC(icp6s_pmtuchg);
        }
 }
 
@@ -2276,7 +2276,7 @@ icmp6_redirect_input(struct mbuf *m, int
 #else
        IP6_EXTHDR_GET(nd_rd, struct nd_redirect *, m, off, icmp6len);
        if (nd_rd == NULL) {
-               V_icmp6stat.icp6s_tooshort++;
+               ICMP6STAT_INC(icp6s_tooshort);
                return;
        }
 #endif
@@ -2439,7 +2439,7 @@ icmp6_redirect_input(struct mbuf *m, int
        return;
 
  bad:
-       V_icmp6stat.icp6s_badredirect++;
+       ICMP6STAT_INC(icp6s_badredirect);
        m_freem(m);
 }
 
@@ -2715,7 +2715,7 @@ noredhdropt:;
                icmp6_ifstat_inc(outif, ifs6_out_msg);
                icmp6_ifstat_inc(outif, ifs6_out_redirect);
        }
-       V_icmp6stat.icp6s_outhist[ND_REDIRECT]++;
+       ICMP6STAT_INC(icp6s_outhist[ND_REDIRECT]);
 
        return;
 

Modified: head/sys/netinet6/mld6.c
==============================================================================
--- head/sys/netinet6/mld6.c    Sun Apr 12 11:53:12 2009        (r190963)
+++ head/sys/netinet6/mld6.c    Sun Apr 12 13:22:33 2009        (r190964)
@@ -288,7 +288,7 @@ mld6_input(struct mbuf *m, int off)
 #else
        IP6_EXTHDR_GET(mldh, struct mld_hdr *, m, off, sizeof(*mldh));
        if (mldh == NULL) {
-               V_icmp6stat.icp6s_tooshort++;
+               ICMP6STAT_INC(icp6s_tooshort);
                return;
        }
 #endif
@@ -517,7 +517,7 @@ mld6_sendpkt(struct in6_multi *in6m, int
        im6o.im6o_multicast_loop = (ip6_mrouter != NULL);
 
        /* increment output statictics */
-       V_icmp6stat.icp6s_outhist[type]++;
+       ICMP6STAT_INC(icp6s_outhist[type]);
 
        ip6_output(mh, &V_ip6_opts, NULL, 0, &im6o, &outif, NULL);
        if (outif) {

Modified: head/sys/netinet6/nd6.c
==============================================================================
--- head/sys/netinet6/nd6.c     Sun Apr 12 11:53:12 2009        (r190963)
+++ head/sys/netinet6/nd6.c     Sun Apr 12 13:22:33 2009        (r190964)
@@ -374,7 +374,7 @@ nd6_options(union nd_opts *ndopts)
                         * Message validation requires that all included
                         * options have a length that is greater than zero.
                         */
-                       V_icmp6stat.icp6s_nd_badopt++;
+                       ICMP6STAT_INC(icp6s_nd_badopt);
                        bzero(ndopts, sizeof(*ndopts));
                        return -1;
                }
@@ -418,7 +418,7 @@ nd6_options(union nd_opts *ndopts)
 skip1:
                i++;
                if (i > V_nd6_maxndopt) {
-                       V_icmp6stat.icp6s_nd_toomanyopt++;
+                       ICMP6STAT_INC(icp6s_nd_toomanyopt);
                        nd6log((LOG_INFO, "too many loop in nd opt\n"));
                        break;
                }

Modified: head/sys/netinet6/nd6_nbr.c
==============================================================================
--- head/sys/netinet6/nd6_nbr.c Sun Apr 12 11:53:12 2009        (r190963)
+++ head/sys/netinet6/nd6_nbr.c Sun Apr 12 13:22:33 2009        (r190964)
@@ -128,7 +128,7 @@ nd6_ns_input(struct mbuf *m, int off, in
 #else
        IP6_EXTHDR_GET(nd_ns, struct nd_neighbor_solicit *, m, off, icmp6len);
        if (nd_ns == NULL) {
-               V_icmp6stat.icp6s_tooshort++;
+               ICMP6STAT_INC(icp6s_tooshort);
                return;
        }
 #endif
@@ -365,7 +365,7 @@ nd6_ns_input(struct mbuf *m, int off, in
                ip6_sprintf(ip6bufs, &daddr6)));
        nd6log((LOG_ERR, "nd6_ns_input: tgt=%s\n",
                ip6_sprintf(ip6bufs, &taddr6)));
-       V_icmp6stat.icp6s_badns++;
+       ICMP6STAT_INC(icp6s_badns);
        m_freem(m);
 }
 
@@ -563,7 +563,7 @@ nd6_ns_output(struct ifnet *ifp, const s
        ip6_output(m, NULL, &ro, dad ? IPV6_UNSPECSRC : 0, &im6o, NULL, NULL);
        icmp6_ifstat_inc(ifp, ifs6_out_msg);
        icmp6_ifstat_inc(ifp, ifs6_out_neighborsolicit);
-       V_icmp6stat.icp6s_outhist[ND_NEIGHBOR_SOLICIT]++;
+       ICMP6STAT_INC(icp6s_outhist[ND_NEIGHBOR_SOLICIT]);
 
        if (ro.ro_rt) {         /* we don't cache this route. */
                RTFREE(ro.ro_rt);
@@ -625,7 +625,7 @@ nd6_na_input(struct mbuf *m, int off, in
 #else
        IP6_EXTHDR_GET(nd_na, struct nd_neighbor_advert *, m, off, icmp6len);
        if (nd_na == NULL) {
-               V_icmp6stat.icp6s_tooshort++;
+               ICMP6STAT_INC(icp6s_tooshort);
                return;
        }
 #endif
@@ -897,7 +897,7 @@ nd6_na_input(struct mbuf *m, int off, in
        if (ln != NULL)
                LLE_WUNLOCK(ln);
 
-       V_icmp6stat.icp6s_badna++;
+       ICMP6STAT_INC(icp6s_badna);
        m_freem(m);
 }
 
@@ -1065,7 +1065,7 @@ nd6_na_output(struct ifnet *ifp, const s
        ip6_output(m, NULL, &ro, 0, &im6o, NULL, NULL);
        icmp6_ifstat_inc(ifp, ifs6_out_msg);
        icmp6_ifstat_inc(ifp, ifs6_out_neighboradvert);
-       V_icmp6stat.icp6s_outhist[ND_NEIGHBOR_ADVERT]++;
+       ICMP6STAT_INC(icp6s_outhist[ND_NEIGHBOR_ADVERT]);
 
        if (ro.ro_rt) {         /* we don't cache this route. */
                RTFREE(ro.ro_rt);

Modified: head/sys/netinet6/nd6_rtr.c
==============================================================================
--- head/sys/netinet6/nd6_rtr.c Sun Apr 12 11:53:12 2009        (r190963)
+++ head/sys/netinet6/nd6_rtr.c Sun Apr 12 13:22:33 2009        (r190964)
@@ -155,7 +155,7 @@ nd6_rs_input(struct mbuf *m, int off, in
 #else
        IP6_EXTHDR_GET(nd_rs, struct nd_router_solicit *, m, off, icmp6len);
        if (nd_rs == NULL) {
-               V_icmp6stat.icp6s_tooshort++;
+               ICMP6STAT_INC(icp6s_tooshort);
                return;
        }
 #endif
@@ -190,7 +190,7 @@ nd6_rs_input(struct mbuf *m, int off, in
        return;
 
  bad:
-       V_icmp6stat.icp6s_badrs++;
+       ICMP6STAT_INC(icp6s_badrs);
        m_freem(m);
 }
 
@@ -246,7 +246,7 @@ nd6_ra_input(struct mbuf *m, int off, in
 #else
        IP6_EXTHDR_GET(nd_ra, struct nd_router_advert *, m, off, icmp6len);
        if (nd_ra == NULL) {
-               V_icmp6stat.icp6s_tooshort++;
+               ICMP6STAT_INC(icp6s_tooshort);
                return;
        }
 #endif
@@ -422,7 +422,7 @@ nd6_ra_input(struct mbuf *m, int off, in
        return;
 
  bad:
-       V_icmp6stat.icp6s_badra++;
+       ICMP6STAT_INC(icp6s_badra);
        m_freem(m);
 }
 

Modified: head/sys/netinet6/raw_ip6.c
==============================================================================
--- head/sys/netinet6/raw_ip6.c Sun Apr 12 11:53:12 2009        (r190963)
+++ head/sys/netinet6/raw_ip6.c Sun Apr 12 13:22:33 2009        (r190964)
@@ -477,7 +477,7 @@ rip6_output(m, va_alist)
        if (so->so_proto->pr_protocol == IPPROTO_ICMPV6) {
                if (oifp)
                        icmp6_ifoutstat_inc(oifp, type, code);
-               V_icmp6stat.icp6s_outhist[type]++;
+               ICMP6STAT_INC(icp6s_outhist[type]);
        } else
                V_rip6stat.rip6s_opackets++;
 
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to