Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty...
[firefly-linux-kernel-4.4.55.git] / net / ipv4 / ping.c
index 55c4ee1bba062276ff2a21055dfa6d0a01a71513..2e91006d6076492fb0fe3b0bdf831c42bca56756 100644 (file)
@@ -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;