summaryrefslogtreecommitdiffstats
path: root/sys/contrib
diff options
context:
space:
mode:
authormlaier <mlaier@FreeBSD.org>2004-09-11 11:18:25 +0000
committermlaier <mlaier@FreeBSD.org>2004-09-11 11:18:25 +0000
commit431ad267578eeeda7386a6768916be79c04bd2e7 (patch)
tree1998d0acac1ec9b50165d3b02fa2a03f4630a1ff /sys/contrib
parent1e56230631d33cf86f623a7cf882caa3ad9b1299 (diff)
downloadFreeBSD-src-431ad267578eeeda7386a6768916be79c04bd2e7.zip
FreeBSD-src-431ad267578eeeda7386a6768916be79c04bd2e7.tar.gz
One more round on the H/W supported checksum code: Fix NICs that can't do
the pseudo header. We really need the TCP packet length here. This happens to end up in ip->ip_len in tcp_input.c, but here we should get it from the len function variable instead. Submitted by: yongari Tested by: Nicolas Linard, yongari (sparc64 + hme) MFC after: 5 days
Diffstat (limited to 'sys/contrib')
-rw-r--r--sys/contrib/pf/net/pf.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/contrib/pf/net/pf.c b/sys/contrib/pf/net/pf.c
index c4a55bf..9e2bfee 100644
--- a/sys/contrib/pf/net/pf.c
+++ b/sys/contrib/pf/net/pf.c
@@ -5619,9 +5619,8 @@ pf_check_proto_cksum(struct mbuf *m, int off, int len, u_int8_t p, sa_family_t a
} else {
ip = mtod(m, struct ip *);
sum = in_pseudo(ip->ip_src.s_addr,
- ip->ip_dst.s_addr,
- htonl(m->m_pkthdr.csum_data +
- IPPROTO_TCP + ntohs(ip->ip_len)));
+ ip->ip_dst.s_addr, htonl((u_short)len +
+ m->m_pkthdr.csum_data + IPPROTO_TCP));
}
sum ^= 0xffff;
++hw_assist;
OpenPOWER on IntegriCloud