From fc1211a6abd377660b11181cd45ea0ff3f4fd136 Mon Sep 17 00:00:00 2001 From: mycroft Date: Tue, 19 Jan 1999 21:58:40 +0000 Subject: [PATCH] Don't overwrite the checksum fields when checking them. There's no reason to do this, and it screws up ICMP replies. XXX The returned IP checksum and length are still wrong. --- sys/netinet/ip_input.c | 4 ++-- sys/netinet/tcp_input.c | 4 ++-- sys/netinet/udp_usrreq.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 088ac419d864..821433e3a397 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1,4 +1,4 @@ -/* $NetBSD: ip_input.c,v 1.77 1999/01/11 22:35:06 thorpej Exp $ */ +/* $NetBSD: ip_input.c,v 1.78 1999/01/19 21:58:40 mycroft Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -340,7 +340,7 @@ next: } ip = mtod(m, struct ip *); } - if ((ip->ip_sum = in_cksum(m, hlen)) != 0) { + if (in_cksum(m, hlen) != 0) { ipstat.ips_badsum++; goto bad; } diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index db659e082ae5..d2b6e7454934 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_input.c,v 1.72 1998/12/18 21:38:02 thorpej Exp $ */ +/* $NetBSD: tcp_input.c,v 1.73 1999/01/19 21:58:41 mycroft Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -486,7 +486,7 @@ tcp_input(m, va_alist) bzero(ti->ti_x1, sizeof ti->ti_x1); ti->ti_len = (u_int16_t)tlen; HTONS(ti->ti_len); - if ((ti->ti_sum = in_cksum(m, len)) != 0) { + if (in_cksum(m, len) != 0) { tcpstat.tcps_rcvbadsum++; goto drop; } diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 398bdda98a77..be324d1cf2a6 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1,4 +1,4 @@ -/* $NetBSD: udp_usrreq.c,v 1.45 1999/01/11 22:35:07 thorpej Exp $ */ +/* $NetBSD: udp_usrreq.c,v 1.46 1999/01/19 21:58:41 mycroft Exp $ */ /* * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995 @@ -164,7 +164,7 @@ udp_input(m, va_alist) bzero(((struct ipovly *)ip)->ih_x1, sizeof ((struct ipovly *)ip)->ih_x1); ((struct ipovly *)ip)->ih_len = uh->uh_ulen; - if ((uh->uh_sum = in_cksum(m, len + sizeof (struct ip))) != 0) { + if (in_cksum(m, len + sizeof (struct ip)) != 0) { udpstat.udps_badsum++; m_freem(m); return;