summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_input.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2014-01-23 23:51:30 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2014-01-23 23:51:30 +0000
commitffa8fe65db00fd639b90c9956254c155e9b3d918 (patch)
tree7fb3c5807fa887ceb2153e80c3d7117e4c402deb /sys/netinet/ip_input.c
parent4800f8aaae13ed55179c1cdcb4c320a7e3ae3e8c (diff)
since the cksum rewrite the counters for hardware checksummed packets
are are lie, since the software engine emulates hardware offloading and that is later indistinguishable. so kill the hw cksummed counters. introduce software checksummed packet counters instead. tcp/udp handles ip & ipvshit, ip cksum covered, 6 has no ip layer cksum. as before we still have a miscounting bug for inbound with pf on, to be fixed in the next step. found by, prodding & ok naddy
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r--sys/netinet/ip_input.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 5b46a120a64..2d434471329 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_input.c,v 1.224 2014/01/09 06:29:06 tedu Exp $ */
+/* $OpenBSD: ip_input.c,v 1.225 2014/01/23 23:51:29 henning Exp $ */
/* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */
/*
@@ -274,19 +274,18 @@ ipv4_input(struct mbuf *m)
if ((m->m_pkthdr.csum_flags & M_IPV4_CSUM_IN_OK) == 0) {
if (m->m_pkthdr.csum_flags & M_IPV4_CSUM_IN_BAD) {
- ipstat.ips_inhwcsum++;
ipstat.ips_badsum++;
goto bad;
}
+ ipstat.ips_inswcsum++;
if (in_cksum(m, hlen) != 0) {
ipstat.ips_badsum++;
goto bad;
}
- } else {
+ } else
+ /* XXXHB20140123 */
m->m_pkthdr.csum_flags &= ~M_IPV4_CSUM_IN_OK;
- ipstat.ips_inhwcsum++;
- }
/* Retrieve the packet length. */
len = ntohs(ip->ip_len);