Looks like SO_RCVBUF should be limited to 65535.

Tom May (ftom@netcom.com)
Wed, 12 Jun 1996 11:11:41 -0700


On linux 2.0.0, running samba with SO_RCVBUF=65536 was causing
failures. Setting SO_RCVBUF=65535 works fine. Perhaps the following
patch, which makes setting SO_RCVBUF work like setting SO_SNDBUF, is
the proper solution.

--- linux/net/core/sock.c.0 Tue Jun 11 09:02:45 1996
+++ linux/net/core/sock.c Wed Jun 12 10:49:37 1996
@@ -173,30 +173,32 @@
case SO_SNDBUF:
if(val > SK_WMEM_MAX*2)
val = SK_WMEM_MAX*2;
if(val < 256)
val = 256;
if(val > 65535)
val = 65535;
sk->sndbuf = val;
return 0;

case SO_RCVBUF:
if(val > SK_RMEM_MAX*2)
val = SK_RMEM_MAX*2;
if(val < 256)
val = 256;
+ if(val > 65535)
+ val = 65535;
sk->rcvbuf = val;
return(0);

case SO_KEEPALIVE:
sk->keepopen = valbool;
return(0);

case SO_OOBINLINE:
sk->urginline = valbool;
return(0);

case SO_NO_CHECK:
sk->no_check = valbool;
return(0);

Tom.