aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/raw.c
diff options
context:
space:
mode:
authorDavid L Stevens <dlstevens@us.ibm.com>2007-09-17 12:57:33 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:51:28 -0400
commit96793b482540f3a26e2188eaf75cb56b7829d3e3 (patch)
tree3dfc2871b69cc358ed55dc2adc3bfeef47382cb3 /net/ipv4/raw.c
parent14878f75abd5bf1d38becb405801cd491ee215dc (diff)
[IPV4]: Add ICMPMsgStats MIB (RFC 4293)
Background: RFC 4293 deprecates existing individual, named ICMP type counters to be replaced with the ICMPMsgStatsTable. This table includes entries for both IPv4 and IPv6, and requires counting of all ICMP types, whether or not the machine implements the type. These patches "remove" (but not really) the existing counters, and replace them with the ICMPMsgStats tables for v4 and v6. It includes the named counters in the /proc places they were, but gets the values for them from the new tables. It also counts packets generated from raw socket output (e.g., OutEchoes, MLD queries, RA's from radvd, etc). Changes: 1) create icmpmsg_statistics mib 2) create icmpv6msg_statistics mib 3) modify existing counters to use these 4) modify /proc/net/snmp to add "IcmpMsg" with all ICMP types listed by number for easy SNMP parsing 5) modify /proc/net/snmp printing for "Icmp" to get the named data from new counters. Signed-off-by: David L Stevens <dlstevens@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/raw.c')
-rw-r--r--net/ipv4/raw.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 216e01b0f44a..07070c7067f3 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -314,6 +314,9 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length,
314 314
315 iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); 315 iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
316 } 316 }
317 if (iph->protocol == IPPROTO_ICMP)
318 icmp_out_count(((struct icmphdr *)
319 skb_transport_header(skb))->type);
317 320
318 err = NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, skb, NULL, rt->u.dst.dev, 321 err = NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, skb, NULL, rt->u.dst.dev,
319 dst_output); 322 dst_output);