aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLi Wei2013-02-20 18:09:54 -0600
committerGreg Kroah-Hartman2013-02-28 08:32:27 -0600
commitb18383129b00d2d6aac160f55e27c5ba1cf9d49b (patch)
tree7693b980d0bc8675f7195d000649874efe6b49b5
parentbd986521a6e35a301e45d2831501acc172fe2a8f (diff)
downloadkernel-common-b18383129b00d2d6aac160f55e27c5ba1cf9d49b.tar.gz
kernel-common-b18383129b00d2d6aac160f55e27c5ba1cf9d49b.tar.xz
kernel-common-b18383129b00d2d6aac160f55e27c5ba1cf9d49b.zip
ipv4: fix a bug in ping_err().
[ Upstream commit b531ed61a2a2a77eeb2f7c88b49aa5ec7d9880d8 ] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/ipv4/ping.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 39b403f854c..0ae2cf1dada 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -320,8 +320,8 @@ void ping_err(struct sk_buff *skb, u32 info)
320 struct iphdr *iph = (struct iphdr *)skb->data; 320 struct iphdr *iph = (struct iphdr *)skb->data;
321 struct icmphdr *icmph = (struct icmphdr *)(skb->data+(iph->ihl<<2)); 321 struct icmphdr *icmph = (struct icmphdr *)(skb->data+(iph->ihl<<2));
322 struct inet_sock *inet_sock; 322 struct inet_sock *inet_sock;
323 int type = icmph->type; 323 int type = icmp_hdr(skb)->type;
324 int code = icmph->code; 324 int code = icmp_hdr(skb)->code;
325 struct net *net = dev_net(skb->dev); 325 struct net *net = dev_net(skb->dev);
326 struct sock *sk; 326 struct sock *sk;
327 int harderr; 327 int harderr;