FreeBSD Bugzilla – Attachment 165382 Details for
Bug 206122
tcp keep-alive message sent without timestamp option
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
tcp keep-alive message sent with timestamp option.
tcp_subr.diff (text/plain), 1.49 KB, created by
Yongmin Cho
on 2016-01-11 01:28:46 UTC
(
hide
)
Description:
tcp keep-alive message sent with timestamp option.
Filename:
MIME Type:
Creator:
Yongmin Cho
Created:
2016-01-11 01:28:46 UTC
Size:
1.49 KB
patch
obsolete
>Index: sys/netinet/tcp_subr.c >=================================================================== >--- sys/netinet/tcp_subr.c (revision 292681) >+++ sys/netinet/tcp_subr.c (working copy) >@@ -835,7 +835,7 @@ void > tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, > tcp_seq ack, tcp_seq seq, int flags) > { >- int tlen; >+ int tlen, optlen = 0; > int win = 0; > struct ip *ip; > struct tcphdr *nth; >@@ -845,6 +845,7 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct > #endif /* INET6 */ > int ipflags = 0; > struct inpcb *inp; >+ struct tcpopt to; > > KASSERT(tp != NULL || m != NULL, ("tcp_respond: tp and m both NULL")); > >@@ -943,6 +944,17 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct > ip->ip_off |= htons(IP_DF); > } > #endif >+ if (tp != NULL) { >+ to.to_flags = 0; >+ if ((tp->t_flags & (TF_REQ_TSTMP|TF_RCVD_TSTMP|TF_NOOPT)) == >+ (TF_REQ_TSTMP|TF_RCVD_TSTMP)) { >+ to.to_flags |= TOF_TS; >+ to.to_tsval = tcp_ts_getticks() + tp->ts_offset; >+ to.to_tsecr = tp->ts_recent; >+ tlen += optlen = tcp_addoptions(&to, >+ (u_char *)(nth + 1)); >+ } >+ } > m->m_len = tlen; > m->m_pkthdr.len = tlen; > m->m_pkthdr.rcvif = NULL; >@@ -965,7 +977,7 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct > nth->th_seq = htonl(seq); > nth->th_ack = htonl(ack); > nth->th_x2 = 0; >- nth->th_off = sizeof (struct tcphdr) >> 2; >+ nth->th_off = (sizeof (struct tcphdr) + optlen) >> 2; > nth->th_flags = flags; > if (tp != NULL) > nth->th_win = htons((u_short) (win >> tp->rcv_scale));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 206122
: 165382