Merge 4.4-Lite-2: always check the UDP checksum if it is present, even

if we are not generating checksums.  (Save a test in the input path.)
This commit is contained in:
Garrett Wollman 1995-09-22 19:56:26 +00:00
parent 77b573149a
commit 6dfab5b1e1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=10961

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1982, 1986, 1988, 1990, 1993
* Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -30,8 +30,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)udp_usrreq.c 8.4 (Berkeley) 1/21/94
* $Id: udp_usrreq.c,v 1.12 1995/05/30 08:10:02 rgrimes Exp $
* @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95
* $Id: udp_usrreq.c,v 1.13 1995/08/17 22:09:14 olah Exp $
*/
#include <sys/param.h>
@ -153,7 +153,7 @@ udp_input(m, iphlen)
/*
* Checksum extended UDP header and data.
*/
if (udpcksum && uh->uh_sum) {
if (uh->uh_sum) {
((struct ipovly *)ip)->ih_next = 0;
((struct ipovly *)ip)->ih_prev = 0;
((struct ipovly *)ip)->ih_x1 = 0;
@ -491,7 +491,7 @@ udp_usrreq(so, req, m, addr, control)
int s;
if (req == PRU_CONTROL)
return (in_control(so, (int)m, (caddr_t)addr,
return (in_control(so, (u_long)m, (caddr_t)addr,
(struct ifnet *)control));
if (inp == NULL && req != PRU_ATTACH) {
error = EINVAL;