Commit b531ed61 authored by Li Wei's avatar Li Wei Committed by David S. Miller

ipv4: fix a bug in ping_err().

We should get 'type' and 'code' from the outer ICMP header.
Signed-off-by: default avatarLi Wei <lw@cn.fujitsu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a0b1c429
...@@ -322,8 +322,8 @@ void ping_err(struct sk_buff *skb, u32 info) ...@@ -322,8 +322,8 @@ void ping_err(struct sk_buff *skb, u32 info)
struct iphdr *iph = (struct iphdr *)skb->data; struct iphdr *iph = (struct iphdr *)skb->data;
struct icmphdr *icmph = (struct icmphdr *)(skb->data+(iph->ihl<<2)); struct icmphdr *icmph = (struct icmphdr *)(skb->data+(iph->ihl<<2));
struct inet_sock *inet_sock; struct inet_sock *inet_sock;
int type = icmph->type; int type = icmp_hdr(skb)->type;
int code = icmph->code; int code = icmp_hdr(skb)->code;
struct net *net = dev_net(skb->dev); struct net *net = dev_net(skb->dev);
struct sock *sk; struct sock *sk;
int harderr; int harderr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment