X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Ftcp%2Ftcp_output.c;h=6bcca31ca77c0338f99e7351d50f86945ee92231;hb=dbd366b239c0506b0d9984e7481967e038f10a23;hp=a21c012b5b7163c02db769e4a02a6a3d066ccba5;hpb=573f44c2f5c883753bc9880eead1bd662586521d;p=vpp.git diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c index a21c012b5b7..6bcca31ca77 100644 --- a/src/vnet/tcp/tcp_output.c +++ b/src/vnet/tcp/tcp_output.c @@ -143,13 +143,11 @@ tcp_update_rcv_wnd (tcp_connection_t * tc) wnd = available_space; } - /* Make sure we have a multiple of rcv_wscale */ + /* Make sure we have a multiple of 1 << rcv_wscale. We round up to + * avoid advertising a window less than mss which could happen if + * 1 << rcv_wscale < mss */ if (wnd && tc->rcv_wscale) - { - wnd &= ~((1 << tc->rcv_wscale) - 1); - if (wnd == 0) - wnd = 1 << tc->rcv_wscale; - } + wnd = round_pow2 (wnd, 1 << tc->rcv_wscale); tc->rcv_wnd = clib_min (wnd, TCP_WND_MAX << tc->rcv_wscale); }