From 3f794232f1c5e9d61a2eb9452f651c656b66d965 Mon Sep 17 00:00:00 2001 From: "Angelos D. Keromytis" Date: Sat, 23 Jun 2001 03:42:11 +0000 Subject: Initialize only if no hardware checksumming. --- sys/netinet/udp_usrreq.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sys/netinet') 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) { -- cgit v1.2.3