netfilter: increase IPSTATS_MIB_CSUMERRORS stat
authorTaehee Yoo <ap420073@gmail.com>
Fri, 16 Feb 2018 19:18:15 +0000 (04:18 +0900)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sun, 25 Feb 2018 19:14:18 +0000 (20:14 +0100)
In the ip_rcv, IPSTATS_MIB_CSUMERRORS is increased when
checksum error is occurred.
bridge netfilter routine should increase IPSTATS_MIB_CSUMERRORS.

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/bridge/br_netfilter_hooks.c

index 27f1d4f2114ab9dadf908dfd10105c9daac30230..9b16eaf3381960def1d938d2977e6c967a02c72a 100644 (file)
@@ -214,7 +214,7 @@ static int br_validate_ipv4(struct net *net, struct sk_buff *skb)
 
        iph = ip_hdr(skb);
        if (unlikely(ip_fast_csum((u8 *)iph, iph->ihl)))
-               goto inhdr_error;
+               goto csum_error;
 
        len = ntohs(iph->tot_len);
        if (skb->len < len) {
@@ -236,6 +236,8 @@ static int br_validate_ipv4(struct net *net, struct sk_buff *skb)
         */
        return 0;
 
+csum_error:
+       __IP_INC_STATS(net, IPSTATS_MIB_CSUMERRORS);
 inhdr_error:
        __IP_INC_STATS(net, IPSTATS_MIB_INHDRERRORS);
 drop: