summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2010-09-29 19:42:11 +0000
committerclaudio <claudio@openbsd.org>2010-09-29 19:42:11 +0000
commit8733f6676ac542282cb6a8bb1aee03e471bc0603 (patch)
tree053adb029ac5cd693fe24d5093c3d3c10e213c3f /sys/netinet/tcp_input.c
parentThe attach function can return 1 now because there is no more priority (diff)
downloadwireguard-openbsd-8733f6676ac542282cb6a8bb1aee03e471bc0603.tar.xz
wireguard-openbsd-8733f6676ac542282cb6a8bb1aee03e471bc0603.zip
Initialize the ts_recent (received timestamp) field in the newly created
socket from the information we have in the syncache. Also bzero() the tcpcb that is passed to tcp_dooptions() just to be sure.
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r--sys/netinet/tcp_input.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 61bf7e8f230..66ad114f222 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_input.c,v 1.238 2010/09/29 18:00:19 claudio Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.239 2010/09/29 19:42:11 claudio Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
@@ -3812,6 +3812,7 @@ syn_cache_get(struct sockaddr *src, struct sockaddr *dst, struct tcphdr *th,
#endif
tp->ts_modulate = sc->sc_modulate;
+ tp->ts_recent = sc->sc_timestamp;
tp->iss = sc->sc_iss;
tp->irs = sc->sc_irs;
tcp_sendseqinit(tp);
@@ -3992,6 +3993,7 @@ syn_cache_add(struct sockaddr *src, struct sockaddr *dst, struct tcphdr *th,
#else
if (optp) {
#endif
+ bzero(&tb, sizeof(tb));
tb.pf = tp->pf;
#ifdef TCP_SACK
tb.sack_enable = tp->sack_enable;