In tcp_respond(), clear the m_pkthdr.csum_flags that was inherited from the

received packet so that the checksum is not performed twice.  Also,
tcp_respond() does not fill-in the m_pkthdr.csum_data, so a h/w checksum may
have the wrong offset.

OK from Jason Thorpe.
This commit is contained in:
heas 2005-01-03 19:47:30 +00:00
parent 546bb99833
commit fe4b3cd078

View File

@ -1,4 +1,4 @@
/* $NetBSD: tcp_subr.c,v 1.176 2004/12/19 06:42:24 christos Exp $ */
/* $NetBSD: tcp_subr.c,v 1.177 2005/01/03 19:47:30 heas Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -98,7 +98,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.176 2004/12/19 06:42:24 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.177 2005/01/03 19:47:30 heas Exp $");
#include "opt_inet.h"
#include "opt_ipsec.h"
@ -689,6 +689,9 @@ tcp_respond(tp, template, m, th0, ack, seq, flags)
m_freem(m);
return EAFNOSUPPORT;
}
/* clear h/w csum flags inherited from rx packet */
m->m_pkthdr.csum_flags = 0;
if ((flags & TH_SYN) == 0 || sizeof(*th0) > (th0->th_off << 2))
tlen = sizeof(*th0);
else