summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_output.c
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2001-06-23 06:13:43 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2001-06-23 06:13:43 +0000
commitba2666287e11d56959f52ae7bfa8c235bb5e2816 (patch)
tree63fbc6d0a4d83a87cfac21c797fa5bb965947db3 /sys/netinet/ip_output.c
parenteef448cb79176415734d8304512d02ac04dac782 (diff)
Placeholder, reminder to fix TCP/UDP checksumming right before doing IPsec.
Diffstat (limited to 'sys/netinet/ip_output.c')
-rw-r--r--sys/netinet/ip_output.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 34cbe2ee9e8..72497f6e5e3 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_output.c,v 1.107 2001/06/23 05:55:40 angelos Exp $ */
+/* $OpenBSD: ip_output.c,v 1.108 2001/06/23 06:13:42 angelos Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
@@ -330,6 +330,22 @@ ip_output(m0, va_alist)
sproto = tdb->tdb_sproto;
splx(s);
+ /*
+ * If it needs TCP/UDP hardware-checksumming, do the
+ * computation now.
+ */
+ if (m->m_pkthdr.csum & M_TCPV4_CSUM_OUT &&
+ !(ifp->if_capabilities & IFCAP_CSUM_TCPv4)) {
+ /* XXX Compute TCP checksum */
+ m->m_pkthdr.csum &= ~M_TCPV4_CSUM_OUT; /* Clear */
+ }
+
+ if (m->m_pkthdr.csum & M_UDPV4_CSUM_OUT &&
+ !(ifp->if_capabilities & IFCAP_CSUM_UDPv4)) {
+ /* XXX Compute UDP checksum */
+ m->m_pkthdr.csum &= ~M_UDPV4_CSUM_OUT; /* Clear */
+ }
+
/* If it's not a multicast packet, try to fast-path */
if (!IN_MULTICAST(ip->ip_dst.s_addr)) {
goto sendit;