Skip to content

Commit

Permalink
ipv4: fix a bug in ping_err().
Browse files Browse the repository at this point in the history
We should get 'type' and 'code' from the outer ICMP header.

Signed-off-by: Li Wei <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Li Wei authored and davem330 committed Feb 21, 2013
1 parent a0b1c42 commit b531ed6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/ipv4/ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b531ed6

Please sign in to comment.