Return-Path: Message-Id: <20130326173606.672990629@goodmis.org> Date: Tue, 26 Mar 2013 13:21:41 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Li Wei , "David S. Miller" Subject: [PATCH 42/86] ipv4: fix a bug in ping_err(). References: <20130326172059.136127374@goodmis.org> Content-Disposition: inline; filename=0042-ipv4-fix-a-bug-in-ping_err.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: 3.6.11.1 stable review patch. If anyone has any objections, please let me know. ------------------ From: Li Wei [ Upstream commit b531ed61a2a2a77eeb2f7c88b49aa5ec7d9880d8 ] We should get 'type' and 'code' from the outer ICMP header. Signed-off-by: Li Wei Signed-off-by: David S. Miller --- net/ipv4/ping.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index 6232d47..920cb0b 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4/ping.c @@ -328,8 +328,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; -- 1.7.10.4