File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -3693,7 +3693,7 @@ EXPORT_SYMBOL(tcp_sock_set_keepcnt);
36933693
36943694int tcp_set_window_clamp (struct sock * sk , int val )
36953695{
3696- u32 old_window_clamp , new_window_clamp ;
3696+ u32 old_window_clamp , new_window_clamp , new_rcv_ssthresh ;
36973697 struct tcp_sock * tp = tcp_sk (sk );
36983698
36993699 if (!val ) {
@@ -3714,12 +3714,12 @@ int tcp_set_window_clamp(struct sock *sk, int val)
37143714 /* Need to apply the reserved mem provisioning only
37153715 * when shrinking the window clamp.
37163716 */
3717- if (new_window_clamp < old_window_clamp )
3717+ if (new_window_clamp < old_window_clamp ) {
37183718 __tcp_adjust_rcv_ssthresh (sk , new_window_clamp );
3719- else
3720- tp -> rcv_ssthresh = clamp ( new_window_clamp ,
3721- tp -> rcv_ssthresh ,
3722- tp -> rcv_wnd );
3719+ } else {
3720+ new_rcv_ssthresh = min ( tp -> rcv_wnd , new_window_clamp );
3721+ tp -> rcv_ssthresh = max ( new_rcv_ssthresh , tp -> rcv_ssthresh );
3722+ }
37233723 return 0 ;
37243724}
37253725
You can’t perform that action at this time.
0 commit comments