Skip to content

Commit

Permalink
netfilter: increase IPSTATS_MIB_CSUMERRORS stat
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Taehee Yoo authored and Pablo Neira Ayuso committed Feb 25, 2018
1 parent f4b7ac5 commit 2412d89
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/bridge/br_netfilter_hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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:
Expand Down

0 comments on commit 2412d89

Please sign in to comment.