diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-11-16 23:40:20 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-18 14:38:59 -0500 |
commit | fb120c0a2775b0d2d095a99ea8432bfb5d444ab2 (patch) | |
tree | 3bbac5493bcb97f2103a405d0f8cb551595d886a /net | |
parent | 282edcece39e08d02c22492d593e4b9b94a65dff (diff) |
ping: dont increment ICMP_MIB_INERRORS
ping module incorrectly increments ICMP_MIB_INERRORS if feeded with a
frame not belonging to its own sockets.
RFC 2011 states that ICMP_MIB_INERRORS should count "the number of ICMP
messages which the entiry received but determined as having
ICMP-specific errors (bad ICMP checksums, bad length, etc.)."
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Vasiliy Kulikov <segoon@openwall.com>
Acked-by: Flavio Leitner <fbl@redhat.com>
Acked-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/ping.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index a06f73fdb3c0..43d4c3b22369 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4/ping.c | |||
@@ -339,7 +339,6 @@ void ping_err(struct sk_buff *skb, u32 info) | |||
339 | sk = ping_v4_lookup(net, iph->daddr, iph->saddr, | 339 | sk = ping_v4_lookup(net, iph->daddr, iph->saddr, |
340 | ntohs(icmph->un.echo.id), skb->dev->ifindex); | 340 | ntohs(icmph->un.echo.id), skb->dev->ifindex); |
341 | if (sk == NULL) { | 341 | if (sk == NULL) { |
342 | ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS); | ||
343 | pr_debug("no socket, dropping\n"); | 342 | pr_debug("no socket, dropping\n"); |
344 | return; /* No socket for error */ | 343 | return; /* No socket for error */ |
345 | } | 344 | } |
@@ -679,7 +678,6 @@ static int ping_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | |||
679 | pr_debug("ping_queue_rcv_skb(sk=%p,sk->num=%d,skb=%p)\n", | 678 | pr_debug("ping_queue_rcv_skb(sk=%p,sk->num=%d,skb=%p)\n", |
680 | inet_sk(sk), inet_sk(sk)->inet_num, skb); | 679 | inet_sk(sk), inet_sk(sk)->inet_num, skb); |
681 | if (sock_queue_rcv_skb(sk, skb) < 0) { | 680 | if (sock_queue_rcv_skb(sk, skb) < 0) { |
682 | ICMP_INC_STATS_BH(sock_net(sk), ICMP_MIB_INERRORS); | ||
683 | kfree_skb(skb); | 681 | kfree_skb(skb); |
684 | pr_debug("ping_queue_rcv_skb -> failed\n"); | 682 | pr_debug("ping_queue_rcv_skb -> failed\n"); |
685 | return -1; | 683 | return -1; |