summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornaddy <naddy@openbsd.org>2009-01-30 17:27:20 +0000
committernaddy <naddy@openbsd.org>2009-01-30 17:27:20 +0000
commit2864ff0bb25e0906cfdad78ce40ca6de16d844fb (patch)
tree94540bcf909754a632189f68be26a1f4e57057c8
parentDelete code which was never used (rtsock.c is even not there). (diff)
downloadwireguard-openbsd-2864ff0bb25e0906cfdad78ce40ca6de16d844fb.tar.xz
wireguard-openbsd-2864ff0bb25e0906cfdad78ce40ca6de16d844fb.zip
sync the part copied from ip_output: always initialize IP checksum
to zero for checksum offload; ok henning@
-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++;