diff options
author | Li Wei <lw@cn.fujitsu.com> | 2013-02-21 01:09:54 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-21 21:25:00 +0100 |
commit | b531ed61a2a2a77eeb2f7c88b49aa5ec7d9880d8 (patch) | |
tree | 7abb06b84175c8ad6ebd5aea3999d7df39e41f3d /net | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next (diff) | |
download | linux-b531ed61a2a2a77eeb2f7c88b49aa5ec7d9880d8.tar.xz linux-b531ed61a2a2a77eeb2f7c88b49aa5ec7d9880d8.zip |
ipv4: fix a bug in ping_err().
We should get 'type' and 'code' from the outer ICMP header.
Signed-off-by: Li Wei <lw@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/ping.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index 55c4ee1bba06..2e91006d6076 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4/ping.c @@ -322,8 +322,8 @@ void ping_err(struct sk_buff *skb, u32 info) struct iphdr *iph = (struct iphdr *)skb->data; struct icmphdr *icmph = (struct icmphdr *)(skb->data+(iph->ihl<<2)); struct inet_sock *inet_sock; - int type = icmph->type; - int code = icmph->code; + int type = icmp_hdr(skb)->type; + int code = icmp_hdr(skb)->code; struct net *net = dev_net(skb->dev); struct sock *sk; int harderr; |