# TCP window scaling value



## gaurav (Sep 8, 2009)

Hello support,

I found in file "tcp_input.c-orig" located at location "usr\src\sys\netinet" at line number 511, "tp->request_r_scale" is incremented depending on condition. 16 bits are reserved for window and its value could be MAX 30 bits.
In your if condition "TCP_MAXWIN << tp->request_r_scale < so->so_rcv.sb_hiwat", if I have "so->so_rcv.sb_hiwat" value to be 524286, then *"tp->request_r_scale" is incremented four times but its value should be 3*.

Reason being, while shifting TCP_MAXWIN,
1st iteration 1111111111111111 < 1111111111111111110 [TRUE]
increment once
2nd iteration 11111111111111110 < 1111111111111111110 [TRUE]
increment again
3rd iteration 111111111111111100 < 1111111111111111110 [TRUE]
increment once
4th iteration 1111111111111111000 < 1111111111111111110 [TRUE]
increment again
5th iteration 11111111111111110000 < 1111111111111111110 [FALSE]

The LSB are zeros, which should be one.

Please tell me if I am wrong.

--Gaurav Goel


----------



## DutchDaemon (Sep 8, 2009)

This is a user/community support forum, not a developer forum. Please ask questions like these on the appropriate FreeBSD mailing lists (http://www.freebsd.org/community/mailinglists.html), where the developers are, of file a PR (http://www.freebsd.org/send-pr.html) if you think this is a bug. Tip: don't use backslashes in paths if you want to be taken seriously.

Closed.


----------

