summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2001-06-23 03:42:11 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2001-06-23 03:42:11 +0000
commit3f794232f1c5e9d61a2eb9452f651c656b66d965 (patch)
tree7a46dc1b5020928ff93406998d1e5a98f1d23ba0 /sys/netinet
parentb2841105c40f0b0ef205c49b4e954939ceff892f (diff)
Initialize only if no hardware checksumming.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/udp_usrreq.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 0a25339bbe3..83e18106505 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udp_usrreq.c,v 1.64 2001/06/23 02:27:11 angelos Exp $ */
+/* $OpenBSD: udp_usrreq.c,v 1.65 2001/06/23 03:42:10 angelos Exp $ */
/* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */
/*
@@ -297,11 +297,11 @@ udp_input(m, va_alist)
} else
#endif /* INET6 */
if (uh->uh_sum) {
- bzero(((struct ipovly *)ip)->ih_x1,
- sizeof ((struct ipovly *)ip)->ih_x1);
- ((struct ipovly *)ip)->ih_len = uh->uh_ulen;
-
if ((m->m_pkthdr.csum & M_UDP_CSUM_IN_OK) == 0) {
+ bzero(((struct ipovly *)ip)->ih_x1,
+ sizeof ((struct ipovly *)ip)->ih_x1);
+ ((struct ipovly *)ip)->ih_len = uh->uh_ulen;
+
if (m->m_pkthdr.csum & M_UDP_CSUM_IN_BAD ||
(uh->uh_sum = in_cksum(m, len +
sizeof (struct ip))) != 0) {