diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-06-23 03:42:11 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-06-23 03:42:11 +0000 |
commit | 3f794232f1c5e9d61a2eb9452f651c656b66d965 (patch) | |
tree | 7a46dc1b5020928ff93406998d1e5a98f1d23ba0 | |
parent | b2841105c40f0b0ef205c49b4e954939ceff892f (diff) |
Initialize only if no hardware checksumming.
-rw-r--r-- | sys/netinet/udp_usrreq.c | 10 |
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) { |