Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_input.c
Show First 20 Lines • Show All 638 Lines • ▼ Show 20 Lines | if (m->m_len < (sizeof(*ip6) + sizeof(*th))) { | ||||
if (m == NULL) { | if (m == NULL) { | ||||
TCPSTAT_INC(tcps_rcvshort); | TCPSTAT_INC(tcps_rcvshort); | ||||
return (IPPROTO_DONE); | return (IPPROTO_DONE); | ||||
} | } | ||||
} | } | ||||
ip6 = mtod(m, struct ip6_hdr *); | ip6 = mtod(m, struct ip6_hdr *); | ||||
th = (struct tcphdr *)((caddr_t)ip6 + off0); | th = (struct tcphdr *)((caddr_t)ip6 + off0); | ||||
if (M_HASHTYPE_GET(m) == M_HASHTYPE_LRO_TCP) | |||||
tlen = m->m_pkthdr.len - off0; | |||||
else | |||||
tlen = sizeof(*ip6) + ntohs(ip6->ip6_plen) - off0; | tlen = sizeof(*ip6) + ntohs(ip6->ip6_plen) - off0; | ||||
if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID_IPV6) { | if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID_IPV6) { | ||||
if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) | if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) | ||||
th->th_sum = m->m_pkthdr.csum_data; | th->th_sum = m->m_pkthdr.csum_data; | ||||
else | else | ||||
th->th_sum = in6_cksum_pseudo(ip6, tlen, | th->th_sum = in6_cksum_pseudo(ip6, tlen, | ||||
IPPROTO_TCP, m->m_pkthdr.csum_data); | IPPROTO_TCP, m->m_pkthdr.csum_data); | ||||
th->th_sum ^= 0xffff; | th->th_sum ^= 0xffff; | ||||
} else | } else | ||||
Show All 34 Lines | if (m->m_len < sizeof (struct tcpiphdr)) { | ||||
if ((m = m_pullup(m, sizeof (struct tcpiphdr))) | if ((m = m_pullup(m, sizeof (struct tcpiphdr))) | ||||
== NULL) { | == NULL) { | ||||
TCPSTAT_INC(tcps_rcvshort); | TCPSTAT_INC(tcps_rcvshort); | ||||
return (IPPROTO_DONE); | return (IPPROTO_DONE); | ||||
} | } | ||||
} | } | ||||
ip = mtod(m, struct ip *); | ip = mtod(m, struct ip *); | ||||
th = (struct tcphdr *)((caddr_t)ip + off0); | th = (struct tcphdr *)((caddr_t)ip + off0); | ||||
if (M_HASHTYPE_GET(m) == M_HASHTYPE_LRO_TCP) | |||||
tlen = m->m_pkthdr.len - off0; | |||||
else | |||||
tlen = ntohs(ip->ip_len) - off0; | tlen = ntohs(ip->ip_len) - off0; | ||||
if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { | if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { | ||||
if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) | if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) | ||||
th->th_sum = m->m_pkthdr.csum_data; | th->th_sum = m->m_pkthdr.csum_data; | ||||
else | else | ||||
th->th_sum = in_pseudo(ip->ip_src.s_addr, | th->th_sum = in_pseudo(ip->ip_src.s_addr, | ||||
ip->ip_dst.s_addr, | ip->ip_dst.s_addr, | ||||
htonl(m->m_pkthdr.csum_data + tlen + | htonl(m->m_pkthdr.csum_data + tlen + | ||||
IPPROTO_TCP)); | IPPROTO_TCP)); | ||||
▲ Show 20 Lines • Show All 3,008 Lines • Show Last 20 Lines |