diff options
Diffstat (limited to 'sys/netinet/ip_output.c')
-rw-r--r-- | sys/netinet/ip_output.c | 18 |
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; |