1

I read kernel tcp/ip stack code, in function tcp_select_initial_window, there is a judgement I could not understand. The snippet code is as below:

if (mss > (1 << *rcv_wscale)) {
    if (!init_rcv_wnd) /* Use default unless specified otherwise */
        init_rcv_wnd = tcp_default_init_rwnd(mss);
    *rcv_wnd = min(*rcv_wnd, init_rcv_wnd * mss);
}

Why do we need to check mss > (1 << *rcv_wscale) here? Is there any specific rule for it? I can not find any detailed description in web. could someone give some explanation about this?

jww
  • 97,681
  • 90
  • 411
  • 885
kenshion
  • 13
  • 5
  • Also see [The reason of non-zero TCP window scale option](https://stackoverflow.com/q/58122062/608639) and [TCP receiving window size higher than net.core.rmem_max](https://stackoverflow.com/q/31546835/608639) – jww Nov 13 '19 at 03:07
  • @jww, I have also checked the posts you mentioned, they do not refer to the judgement "if (mss > (1 << *rcv_wscale))". – kenshion Nov 13 '19 at 04:08
  • could any guys give some advices? – kenshion Nov 19 '19 at 02:49

0 Answers0