diff options
author | gonzo <gonzo@FreeBSD.org> | 2009-04-13 03:08:11 +0000 |
---|---|---|
committer | gonzo <gonzo@FreeBSD.org> | 2009-04-13 03:08:11 +0000 |
commit | 16b2e4b851fc13d49105bf544ef5f7d89526ed3a (patch) | |
tree | 35d65244575c98974af52810da6153780138e0d6 /sys/netinet/ip_icmp.c | |
parent | 2288c0b1828fa2a4aad02035be45876fc1eca752 (diff) | |
parent | 67227c12c0e0a27755a06861b476815955bd8b2b (diff) | |
download | FreeBSD-src-16b2e4b851fc13d49105bf544ef5f7d89526ed3a.zip FreeBSD-src-16b2e4b851fc13d49105bf544ef5f7d89526ed3a.tar.gz |
- Merge from HEAD
Diffstat (limited to 'sys/netinet/ip_icmp.c')
-rw-r--r-- | sys/netinet/ip_icmp.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index baf07d3..fe06b9a 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -180,7 +180,7 @@ icmp_error(struct mbuf *n, int type, int code, uint32_t dest, int mtu) 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 code, uint32_t dest, int mtu) 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_quotelen, oip->ip_len - oiphlen)); */ 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: |