summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@cvs.openbsd.org>2009-01-30 17:27:21 +0000
committerChristian Weisgerber <naddy@cvs.openbsd.org>2009-01-30 17:27:21 +0000
commitae280d1b5f9990fabe1466ff8e7f61df8f618db5 (patch)
treee82cdafabd743c0d14ed98bb659e7a712114f0ad /sys
parentefcd6b70b566fb7da63bb366dd31bc65854ddbdd (diff)
sync the part copied from ip_output: always initialize IP checksum
to zero for checksum offload; ok henning@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/pf.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index 9dc6b29a4b7..a702a60433f 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.631 2009/01/30 10:32:26 dlg Exp $ */
+/* $OpenBSD: pf.c,v 1.632 2009/01/30 17:27:20 naddy Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -4743,14 +4743,13 @@ pf_route(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp,
}
if (ntohs(ip->ip_len) <= ifp->if_mtu) {
+ ip->ip_sum = 0;
if ((ifp->if_capabilities & IFCAP_CSUM_IPv4) &&
ifp->if_bridge == NULL) {
m0->m_pkthdr.csum_flags |= M_IPV4_CSUM_OUT;
ipstat.ips_outhwcsum++;
- } else {
- ip->ip_sum = 0;
+ } else
ip->ip_sum = in_cksum(m0, ip->ip_hl << 2);
- }
/* Update relevant hardware checksum stats for TCP/UDP */
if (m0->m_pkthdr.csum_flags & M_TCPV4_CSUM_OUT)
tcpstat.tcps_outhwcsum++;