summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2014-01-23 23:51:29 +0000
committerhenning <henning@openbsd.org>2014-01-23 23:51:29 +0000
commit095b4e20b18c4bfa90815c2d791ada6bca41e2c3 (patch)
treefa526e1f452844f622a18cad247ee156757e9bbe /sys/netinet/tcp_input.c
parentManufacturer driver update for ARC-1880, 1882, 1213, 1223, 1214 (diff)
downloadwireguard-openbsd-095b4e20b18c4bfa90815c2d791ada6bca41e2c3.tar.xz
wireguard-openbsd-095b4e20b18c4bfa90815c2d791ada6bca41e2c3.zip
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,