summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_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/tcp_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/tcp_input.c')
-rw-r--r--sys/netinet/tcp_input.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 65f6804d54f..ad222356fbc 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_input.c,v 1.270 2014/01/07 17:07:45 mikeb Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.271 2014/01/23 23:51:29 henning Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
@@ -514,10 +514,10 @@ tcp_input(struct mbuf *m, ...)
int sum;
if (m->m_pkthdr.csum_flags & M_TCP_CSUM_IN_BAD) {
- tcpstat.tcps_inhwcsum++;
tcpstat.tcps_rcvbadsum++;
goto drop;
}
+ tcpstat.tcps_inswcsum++;
switch (af) {
case AF_INET:
sum = in4_cksum(m, IPPROTO_TCP, iphlen, tlen);
@@ -533,10 +533,9 @@ tcp_input(struct mbuf *m, ...)
tcpstat.tcps_rcvbadsum++;
goto drop;
}
- } else {
+ } else
+ /* XXXHB20140123 */
m->m_pkthdr.csum_flags &= ~M_TCP_CSUM_IN_OK;
- tcpstat.tcps_inhwcsum++;
- }
/*
* Check that TCP offset makes sense,