[IPV4]: Add ICMPMsgStats MIB (RFC 4293)
[platform/adaptation/renesas_rcar/renesas_kernel.git] / net / ipv4 / raw.c
index 216e01b..07070c7 100644 (file)
@@ -314,6 +314,9 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length,
 
                iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
        }
+       if (iph->protocol == IPPROTO_ICMP)
+               icmp_out_count(((struct icmphdr *)
+                       skb_transport_header(skb))->type);
 
        err = NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, skb, NULL, rt->u.dst.dev,
                      dst_output);