summaryrefslogtreecommitdiffstats
path: root/sys/contrib/pf/net
diff options
context:
space:
mode:
authormlaier <mlaier@FreeBSD.org>2004-07-18 14:25:48 +0000
committermlaier <mlaier@FreeBSD.org>2004-07-18 14:25:48 +0000
commit446479e8a17f0be8bb2bc6c1d3feddc8175e3173 (patch)
tree10d3ac65395cc92ba6a799df2d18b4d0743dd488 /sys/contrib/pf/net
parent8ec9b1951ba8104ace17462a1a2e3d8d94c92756 (diff)
downloadFreeBSD-src-446479e8a17f0be8bb2bc6c1d3feddc8175e3173.zip
FreeBSD-src-446479e8a17f0be8bb2bc6c1d3feddc8175e3173.tar.gz
Fix a stupid attemp to apply host arithmetics to network byte ordered data.
This fixes checksum for some drivers with partial H/W ckcsum offloads. Reported by: Simon 'corecode' Schubert, Devon H. O'Dell, hmp Reviewed by: Pyun YongHyeon
Diffstat (limited to 'sys/contrib/pf/net')
-rw-r--r--sys/contrib/pf/net/pf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/contrib/pf/net/pf.c b/sys/contrib/pf/net/pf.c
index e0063a1..f76f248 100644
--- a/sys/contrib/pf/net/pf.c
+++ b/sys/contrib/pf/net/pf.c
@@ -5605,7 +5605,7 @@ pf_check_proto_cksum(struct mbuf *m, int off, int len, u_int8_t p, sa_family_t a
sum = in_pseudo(ip->ip_src.s_addr,
ip->ip_dst.s_addr,
htonl(m->m_pkthdr.csum_data +
- IPPROTO_TCP) + ip->ip_len);
+ IPPROTO_TCP + ntohs(ip->ip_len)));
}
sum ^= 0xffff;
++hw_assist;
OpenPOWER on IntegriCloud