summaryrefslogtreecommitdiff
path: root/sys/netinet6
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/netinet6
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/netinet6')
-rw-r--r--sys/netinet6/ip6_output.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index ffea92df99b..dbad789dc5c 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_output.c,v 1.152 2014/01/23 01:10:42 naddy Exp $ */
+/* $OpenBSD: ip6_output.c,v 1.153 2014/01/23 23:51:29 henning Exp $ */
/* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */
/*
@@ -84,6 +84,11 @@
#include <netinet/udp.h>
#include <netinet/tcp.h>
+#include <netinet/ip_var.h>
+#include <netinet/tcp_timer.h>
+#include <netinet/tcp_var.h>
+#include <netinet/udp_var.h>
+
#include <netinet6/in6_var.h>
#include <netinet/ip6.h>
#include <netinet/icmp6.h>
@@ -3263,12 +3268,14 @@ in6_proto_cksum_out(struct mbuf *m, struct ifnet *ifp)
if (m->m_pkthdr.csum_flags & M_TCP_CSUM_OUT) {
if (!ifp || !(ifp->if_capabilities & IFCAP_CSUM_TCPv6) ||
ifp->if_bridgeport != NULL) {
+ tcpstat.tcps_outswcsum++;
in6_delayed_cksum(m, IPPROTO_TCP);
m->m_pkthdr.csum_flags &= ~M_TCP_CSUM_OUT; /* Clear */
}
} else if (m->m_pkthdr.csum_flags & M_UDP_CSUM_OUT) {
if (!ifp || !(ifp->if_capabilities & IFCAP_CSUM_UDPv6) ||
ifp->if_bridgeport != NULL) {
+ udpstat.udps_outswcsum++;
in6_delayed_cksum(m, IPPROTO_UDP);
m->m_pkthdr.csum_flags &= ~M_UDP_CSUM_OUT; /* Clear */
}