FreeBSD Bugzilla – Attachment 103918 Details for
Bug 144000
[tcp] setting TCP_MAXSEG by setsockopt() does not seem to have any effect
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch-4.diff
patch-4.diff (text/plain), 1.83 KB, created by
Andre Oppermann
on 2010-08-15 15:13:46 UTC
(
hide
)
Description:
patch-4.diff
Filename:
MIME Type:
Creator:
Andre Oppermann
Created:
2010-08-15 15:13:46 UTC
Size:
1.83 KB
patch
obsolete
>Index: netinet/tcp_usrreq.c >=================================================================== >--- netinet/tcp_usrreq.c (revision 211333) >+++ netinet/tcp_usrreq.c (working copy) >@@ -1340,10 +1340,21 @@ > return (error); > > INP_WLOCK_RECHECK(inp); >- if (optval > 0 && optval <= tp->t_maxseg && >- optval + 40 >= V_tcp_minmss) >- tp->t_maxseg = optval; >- else >+ if (optval > 0 && optval <= tp->t_maxopd && >+ optval + sizeof(struct tcpiphdr) >= V_tcp_minmss) { >+ switch (tp->t_state) { >+ case TCPS_CLOSED: >+ tp->t_maxopd = optval; >+ break; >+ case TCPS_ESTABLISHED: >+ tcp_mss_update(tp, optval, NULL, NULL); >+ break; >+ default: >+ error = EINVAL; >+ } >+ if (!error) >+ tp->t_flags |= TF_USRMAXSEG; >+ } else > error = EINVAL; > INP_WUNLOCK(inp); > break; >Index: netinet/tcp_output.c >=================================================================== >--- netinet/tcp_output.c (revision 211333) >+++ netinet/tcp_output.c (working copy) >@@ -663,6 +690,8 @@ > if (flags & TH_SYN) { > tp->snd_nxt = tp->iss; > to.to_mss = tcp_mssopt(&tp->t_inpcb->inp_inc); >+ if (tp->t_flags & TF_USRMAXSEG) >+ to.to_mss = min(to.to_mss, tp->t_maxopd); > to.to_flags |= TOF_MSS; > } > /* Window scaling. */ >Index: netinet/tcp_var.h >=================================================================== >--- netinet/tcp_var.h (revision 211333) >+++ netinet/tcp_var.h (working copy) >@@ -221,6 +221,7 @@ > #define TF_NEEDSYN 0x000400 /* send SYN (implicit state) */ > #define TF_NEEDFIN 0x000800 /* send FIN (implicit state) */ > #define TF_NOPUSH 0x001000 /* don't push */ >+#define TF_USRMAXSEG 0x002000 /* user set mss */ > #define TF_MORETOCOME 0x010000 /* More data to be appended to sock */ > #define TF_LQ_OVERFLOW 0x020000 /* listen queue overflow */ > #define TF_LASTIDLE 0x040000 /* connection was previously idle */
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 144000
:
103916
|
103917
| 103918