692 /* |
692 /* |
693 * Only allow socket with network configuration |
693 * Only allow socket with network configuration |
694 * privilege to set the initial cwnd to be larger |
694 * privilege to set the initial cwnd to be larger |
695 * than allowed by RFC 3390. |
695 * than allowed by RFC 3390. |
696 */ |
696 */ |
697 if (val <= MIN(4, MAX(2, 4380 / tcp->tcp_mss))) { |
697 if (val > MIN(4, MAX(2, 4380 / tcp->tcp_mss))) { |
698 tcp->tcp_init_cwnd = val; |
698 if ((reterr = secpolicy_ip_config(cr, B_TRUE)) |
699 break; |
699 != 0) { |
700 } |
700 *outlenp = 0; |
701 if ((reterr = secpolicy_ip_config(cr, B_TRUE)) != 0) { |
701 return (reterr); |
702 *outlenp = 0; |
702 } |
703 return (reterr); |
703 if (val > tcp_max_init_cwnd) { |
704 } |
704 *outlenp = 0; |
705 if (val > tcp_max_init_cwnd) { |
705 return (EINVAL); |
706 *outlenp = 0; |
706 } |
707 return (EINVAL); |
707 } |
708 } |
708 |
709 tcp->tcp_init_cwnd = val; |
709 tcp->tcp_init_cwnd = val; |
|
710 |
|
711 /* |
|
712 * If the socket is connected, AND no outbound data |
|
713 * has been sent, reset the actual cwnd values. |
|
714 */ |
|
715 if (tcp->tcp_state == TCPS_ESTABLISHED && |
|
716 tcp->tcp_iss == tcp->tcp_snxt - 1) { |
|
717 tcp->tcp_cwnd = |
|
718 MIN(tcp->tcp_rwnd, val * tcp->tcp_mss); |
|
719 } |
710 break; |
720 break; |
711 |
721 |
712 /* |
722 /* |
713 * TCP_KEEPIDLE is in seconds but TCP_KEEPALIVE_THRESHOLD |
723 * TCP_KEEPIDLE is in seconds but TCP_KEEPALIVE_THRESHOLD |
714 * is in milliseconds. TCP_KEEPIDLE is introduced for |
724 * is in milliseconds. TCP_KEEPIDLE is introduced for |