FreeBSD Bugzilla – Attachment 6737 Details for
Bug 15071
tcp fails to handle TIME_WAIT special case
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 3.57 KB, created by
Jun-ichiro itojun Hagino
on 1999-11-24 09:10:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Jun-ichiro itojun Hagino
Created:
1999-11-24 09:10:00 UTC
Size:
3.57 KB
patch
obsolete
>Index: tcp_input.c >=================================================================== >RCS file: /home/ncvs/src/sys/netinet/tcp_input.c,v >retrieving revision 1.96 >diff -c -r1.96 tcp_input.c >*** tcp_input.c 1999/10/09 20:42:15 1.96 >--- tcp_input.c 1999/11/24 09:00:42 >*************** >*** 112,118 **** > static void tcp_dooptions __P((struct tcpcb *, > u_char *, int, struct tcpiphdr *, struct tcpopt *)); > static void tcp_pulloutofband __P((struct socket *, >! struct tcpiphdr *, struct mbuf *)); > static int tcp_reass __P((struct tcpcb *, struct tcpiphdr *, struct mbuf *)); > static void tcp_xmit_timer __P((struct tcpcb *, int)); > >--- 112,118 ---- > static void tcp_dooptions __P((struct tcpcb *, > u_char *, int, struct tcpiphdr *, struct tcpopt *)); > static void tcp_pulloutofband __P((struct socket *, >! struct tcpiphdr *, struct mbuf *, int)); > static int tcp_reass __P((struct tcpcb *, struct tcpiphdr *, struct mbuf *)); > static void tcp_xmit_timer __P((struct tcpcb *, int)); > >*************** >*** 286,291 **** >--- 286,292 ---- > register int tiflags; > struct socket *so = 0; > int todrop, acked, ourfinisacked, needoutput = 0; >+ int hdroptlen = 0; > struct in_addr laddr; > int dropsocket = 0; > int iss = 0; >*************** >*** 374,383 **** > NTOHS(ti->ti_urp); > > /* >! * Drop TCP, IP headers and TCP options. > */ >! m->m_data += sizeof(struct tcpiphdr)+off-sizeof(struct tcphdr); >! m->m_len -= sizeof(struct tcpiphdr)+off-sizeof(struct tcphdr); > > /* > * Locate pcb for segment. >--- 375,383 ---- > NTOHS(ti->ti_urp); > > /* >! * Compute mbuf offset for TCP data segment. > */ >! hdroptlen = sizeof(struct tcpiphdr) + off - sizeof(struct tcphdr); > > /* > * Locate pcb for segment. >*************** >*** 673,678 **** >--- 673,679 ---- > /* > * Add data to socket buffer. > */ >+ m_adj(m, hdroptlen); > sbappend(&so->so_rcv, m); > sorwakeup(so); > if (tcp_delack_enabled) { >*************** >*** 1240,1246 **** > tcpstat.tcps_rcvpartduppack++; > tcpstat.tcps_rcvpartdupbyte += todrop; > } >! m_adj(m, todrop); > ti->ti_seq += todrop; > ti->ti_len -= todrop; > if (ti->ti_urp > todrop) >--- 1241,1247 ---- > tcpstat.tcps_rcvpartduppack++; > tcpstat.tcps_rcvpartdupbyte += todrop; > } >! hdroptlen += todrop; /* drop from head afterwards */ > ti->ti_seq += todrop; > ti->ti_len -= todrop; > if (ti->ti_urp > todrop) >*************** >*** 1725,1731 **** > && (so->so_options & SO_OOBINLINE) == 0 > #endif > ) >! tcp_pulloutofband(so, ti, m); > } else > /* > * If no out of band data is expected, >--- 1726,1732 ---- > && (so->so_options & SO_OOBINLINE) == 0 > #endif > ) >! tcp_pulloutofband(so, ti, m, hdroptlen); > } else > /* > * If no out of band data is expected, >*************** >*** 1746,1751 **** >--- 1747,1753 ---- > */ > if ((ti->ti_len || (tiflags&TH_FIN)) && > TCPS_HAVERCVDFIN(tp->t_state) == 0) { >+ m_adj(m, hdroptlen); > TCP_REASS(tp, ti, m, so, tiflags); > /* > * Note the amount of data that peer has sent into >*************** >*** 2036,2047 **** > * sequencing purposes. > */ > static void >! tcp_pulloutofband(so, ti, m) > struct socket *so; > struct tcpiphdr *ti; > register struct mbuf *m; > { >! int cnt = ti->ti_urp - 1; > > while (cnt >= 0) { > if (m->m_len > cnt) { >--- 2038,2050 ---- > * sequencing purposes. > */ > static void >! tcp_pulloutofband(so, ti, m, off) > struct socket *so; > struct tcpiphdr *ti; > register struct mbuf *m; >+ int off; > { >! int cnt = off + ti->ti_urp - 1; > > while (cnt >= 0) { > if (m->m_len > cnt) {
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 15071
:
6736
| 6737