diff options
author | andre <andre@FreeBSD.org> | 2007-05-11 18:29:39 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2007-05-11 18:29:39 +0000 |
commit | f33463108a1bf6e488f42d5618c84699f2e09521 (patch) | |
tree | 55cfdb7012b4c1d1d992d7ea3ad5648bfe2656d6 /sys/netinet/tcp_subr.c | |
parent | 50e0c5dd7bbfcd740f73fcaf750532dcac27f579 (diff) | |
download | FreeBSD-src-f33463108a1bf6e488f42d5618c84699f2e09521.zip FreeBSD-src-f33463108a1bf6e488f42d5618c84699f2e09521.tar.gz |
Add the timestamp offset to struct tcptw so we can generate proper
ACKs in TIME_WAIT state that don't get dropped by the PAWS check
on the receiver.
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r-- | sys/netinet/tcp_subr.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index a3bdb08..aa2b86d 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1781,10 +1781,13 @@ tcp_twstart(struct tcpcb *tp) * Set t_recent if timestamps are used on the connection. */ if ((tp->t_flags & (TF_REQ_TSTMP|TF_RCVD_TSTMP|TF_NOOPT)) == - (TF_REQ_TSTMP|TF_RCVD_TSTMP)) + (TF_REQ_TSTMP|TF_RCVD_TSTMP)) { tw->t_recent = tp->ts_recent; - else + tw->ts_offset = tp->ts_offset; + } else { tw->t_recent = 0; + tw->ts_offset = 0; + } tw->snd_nxt = tp->snd_nxt; tw->rcv_nxt = tp->rcv_nxt; @@ -1986,7 +1989,7 @@ tcp_twrespond(struct tcptw *tw, int flags) */ if (tw->t_recent && flags == TH_ACK) { to.to_flags |= TOF_TS; - to.to_tsval = ticks; + to.to_tsval = ticks + tw->ts_offset; to.to_tsecr = tw->t_recent; } optlen = tcp_addoptions(&to, (u_char *)(th + 1)); |