diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-06-23 02:27:12 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-06-23 02:27:12 +0000 |
commit | c2aa68d2ac00ee99e6cd348159b9357e348772df (patch) | |
tree | f76ac23aa90872946925525300f770dcad012bfb /sys/netinet/tcp_input.c | |
parent | b8794969a7662bd38ddaacd86161705cfdd40e16 (diff) |
TCP, UDP, IPv4 input hardware checksumming processing; also IPv4
output hardware checksumming. Not tested yet, but should be done
tonight.
Remain to be solved: interactions with bridge, TCP/UDP output
checksumming, interactions of TCP/UDP checksumming with routing
changes.
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r-- | sys/netinet/tcp_input.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 750b3e58b8f..1b92826a59c 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_input.c,v 1.94 2001/06/12 10:59:53 angelos Exp $ */ +/* $OpenBSD: tcp_input.c,v 1.95 2001/06/23 02:27:10 angelos Exp $ */ /* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */ /* @@ -511,9 +511,12 @@ tcp_input(m, va_alist) bzero(ti->ti_x1, sizeof ti->ti_x1); ti->ti_len = (u_int16_t)tlen; HTONS(ti->ti_len); - if ((ti->ti_sum = in_cksum(m, len)) != 0) { - tcpstat.tcps_rcvbadsum++; - goto drop; + if ((m->m_pkthdr.csum & M_TCP_CSUM_IN_OK) == 0) { + if (m->m_pkthdr.csum & M_TCP_CSUM_IN_BAD || + (ti->ti_sum = in_cksum(m, len)) != 0) { + tcpstat.tcps_rcvbadsum++; + goto drop; + } } break; } |