diff options
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/uts/common/inet/tcp/tcp_opt_data.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/usr/src/uts/common/inet/tcp/tcp_opt_data.c b/usr/src/uts/common/inet/tcp/tcp_opt_data.c index bcec93fcd3..7ac8feeecb 100644 --- a/usr/src/uts/common/inet/tcp/tcp_opt_data.c +++ b/usr/src/uts/common/inet/tcp/tcp_opt_data.c @@ -694,19 +694,29 @@ tcp_opt_set(conn_t *connp, uint_t optset_context, int level, int name, * privilege to set the initial cwnd to be larger * than allowed by RFC 3390. */ - if (val <= MIN(4, MAX(2, 4380 / tcp->tcp_mss))) { - tcp->tcp_init_cwnd = val; - break; - } - if ((reterr = secpolicy_ip_config(cr, B_TRUE)) != 0) { - *outlenp = 0; - return (reterr); - } - if (val > tcp_max_init_cwnd) { - *outlenp = 0; - return (EINVAL); + if (val > MIN(4, MAX(2, 4380 / tcp->tcp_mss))) { + if ((reterr = secpolicy_ip_config(cr, B_TRUE)) + != 0) { + *outlenp = 0; + return (reterr); + } + if (val > tcp_max_init_cwnd) { + *outlenp = 0; + return (EINVAL); + } } + tcp->tcp_init_cwnd = val; + + /* + * If the socket is connected, AND no outbound data + * has been sent, reset the actual cwnd values. + */ + if (tcp->tcp_state == TCPS_ESTABLISHED && + tcp->tcp_iss == tcp->tcp_snxt - 1) { + tcp->tcp_cwnd = + MIN(tcp->tcp_rwnd, val * tcp->tcp_mss); + } break; /* |