summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_subr.c
diff options
context:
space:
mode:
authorangelos <angelos@openbsd.org>2001-06-23 19:02:53 +0000
committerangelos <angelos@openbsd.org>2001-06-23 19:02:53 +0000
commitb40b4d25c8751beb4bb1320bf4ab8cebf8dbe8ec (patch)
treed7d8f6f02d4c38ed343d5956f8177b41e03adbf6 /sys/netinet/tcp_subr.c
parentClear the checksum flags after verification. Also, don't count (diff)
downloadwireguard-openbsd-b40b4d25c8751beb4bb1320bf4ab8cebf8dbe8ec.tar.xz
wireguard-openbsd-b40b4d25c8751beb4bb1320bf4ab8cebf8dbe8ec.zip
Add comment on why checksum deferral is not useful in tcp_respond()
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r--sys/netinet/tcp_subr.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index b8b8cbf7918..38f4243d42d 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_subr.c,v 1.46 2001/06/08 03:53:46 angelos Exp $ */
+/* $OpenBSD: tcp_subr.c,v 1.47 2001/06/23 19:02:53 angelos Exp $ */
/* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */
/*
@@ -424,6 +424,12 @@ tcp_respond(tp, template, m, ack, seq, flags)
{
bzero(ti->ti_x1, sizeof ti->ti_x1);
ti->ti_len = htons((u_short)tlen - sizeof(struct ip));
+
+ /*
+ * There's no point deferring to hardware checksum processing
+ * here, as we only send a minimal TCP packet whose checksum
+ * we need to compute in any case.
+ */
th->th_sum = in_cksum(m, tlen);
((struct ip *)ti)->ip_len = tlen;
((struct ip *)ti)->ip_ttl = ip_defttl;