Version: 3.4.31
Platform: FreeBSD 4.7-RELEASE
There is a bug in the calculation of TCP checksums on *BSD (and possibly SunOS)
platforms. This will cause random timeouts on any connections using any of the proxy
modules (e.g. ftp, rcmd etc).
The bug is caused by the incorrect combination of the two partial sums computed for
each packet. When the two partial sums are the same, the result return is 0xffff
instead of the correct 0x0000.
The following patch fixes the problem. It has been tested on approx 700GB of random
packets with no miscalculation of checksums. Tested on FreeBSD only.
diff -c -r1.1.1.1 fil.c
*** fil.c 2003/02/03 17:28:53 1.1.1.1
--- fil.c 2003/02/07 09:25:25
***************
*** 1387,1396 ****
/*
* Both sum and sum2 are partial sums, so combine them together.
*/
! sum = (sum & 0xffff) + (sum >> 16);
! sum = ~sum & 0xffff;
! sum2 += sum;
! sum2 = (sum2 & 0xffff) + (sum2 >> 16);
# else /* defined(BSD) || defined(sun) */
{
union {
--- 1387,1396 ----
/*
* Both sum and sum2 are partial sums, so combine them together.
*/
! sum += ~sum2 & 0xffff;
! while (sum > 0xffff)
! sum = (sum & 0xffff) + (sum >> 16);
! sum2 = ~sum & 0xffff;
# else /* defined(BSD) || defined(sun) */
{
union {
Best wishes,
David
--
Dr David Hedley
Director, Inty Ltd
www.inty.com, 01454 640500
intY has scanned this email for all known viruses (www.inty.com)