diff mbox series

netfilter: increase IPSTATS_MIB_CSUMERRORS stat

Message ID 20180216191815.26633-1-ap420073@gmail.com
State Accepted
Delegated to: Pablo Neira
Headers show
Series netfilter: increase IPSTATS_MIB_CSUMERRORS stat | expand

Commit Message

Taehee Yoo Feb. 16, 2018, 7:18 p.m. UTC
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>
---
 net/bridge/br_netfilter_hooks.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Pablo Neira Ayuso Feb. 25, 2018, 7:13 p.m. UTC | #1
On Sat, Feb 17, 2018 at 04:18:15AM +0900, Taehee Yoo wrote:
> In the ip_rcv, IPSTATS_MIB_CSUMERRORS is increased when
> checksum error is occurred.
> bridge netfilter routine should increase IPSTATS_MIB_CSUMERRORS.

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/net/bridge/br_netfilter_hooks.c b/net/bridge/br_netfilter_hooks.c
index 27f1d4f..9b16eaf 100644
--- a/net/bridge/br_netfilter_hooks.c
+++ b/net/bridge/br_netfilter_hooks.c
@@ -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: