Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_timewait.c
Show First 20 Lines • Show All 295 Lines • ▼ Show 20 Lines | else | ||||
tw->last_win = 0; | tw->last_win = 0; | ||||
/* | /* | ||||
* Set t_recent if timestamps are used on the connection. | * Set t_recent if timestamps are used on the connection. | ||||
*/ | */ | ||||
if ((tp->t_flags & (TF_REQ_TSTMP|TF_RCVD_TSTMP|TF_NOOPT)) == | 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; | tw->t_recent = tp->ts_recent; | ||||
tw->ts_offset = tp->ts_offset; | |||||
} else { | } else { | ||||
tw->t_recent = 0; | tw->t_recent = 0; | ||||
tw->ts_offset = 0; | |||||
} | } | ||||
tw->snd_nxt = tp->snd_nxt; | tw->snd_nxt = tp->snd_nxt; | ||||
tw->rcv_nxt = tp->rcv_nxt; | tw->rcv_nxt = tp->rcv_nxt; | ||||
tw->iss = tp->iss; | tw->iss = tp->iss; | ||||
tw->irs = tp->irs; | tw->irs = tp->irs; | ||||
tw->t_starttime = tp->t_starttime; | tw->t_starttime = tp->t_starttime; | ||||
tw->tw_time = 0; | tw->tw_time = 0; | ||||
▲ Show 20 Lines • Show All 253 Lines • ▼ Show 20 Lines | #endif | ||||
to.to_flags = 0; | to.to_flags = 0; | ||||
/* | /* | ||||
* Send a timestamp and echo-reply if both our side and our peer | * Send a timestamp and echo-reply if both our side and our peer | ||||
* have sent timestamps in our SYN's and this is not a RST. | * have sent timestamps in our SYN's and this is not a RST. | ||||
*/ | */ | ||||
if (tw->t_recent && flags == TH_ACK) { | if (tw->t_recent && flags == TH_ACK) { | ||||
to.to_flags |= TOF_TS; | to.to_flags |= TOF_TS; | ||||
to.to_tsval = tcp_ts_getticks() + tw->ts_offset; | to.to_tsval = TCP_SBT_TO_TS(tcp_ts_getsbintime()); | ||||
to.to_tsecr = tw->t_recent; | to.to_tsecr = tw->t_recent; | ||||
} | } | ||||
optlen = tcp_addoptions(&to, (u_char *)(th + 1)); | optlen = tcp_addoptions(&to, (u_char *)(th + 1)); | ||||
m->m_len = hdrlen + optlen; | m->m_len = hdrlen + optlen; | ||||
m->m_pkthdr.len = m->m_len; | m->m_pkthdr.len = m->m_len; | ||||
KASSERT(max_linkhdr + m->m_len <= MHLEN, ("tcptw: mbuf too small")); | KASSERT(max_linkhdr + m->m_len <= MHLEN, ("tcptw: mbuf too small")); | ||||
▲ Show 20 Lines • Show All 176 Lines • Show Last 20 Lines |