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.
This commit is contained in:
parent
bef0af5311
commit
fc1211a6ab
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue