setsockopt(..,SO_RCVBUF,..) sets wrong value

From: Manfred Bartz (
Date: Thu Aug 02 2001 - 05:34:47 EST

When I do a setsockopt(..,SO_RCVBUF,..) and then read the value back
with getsockopt(), the reported value is exactly twice of what I set.

Running the same code on Solaris and on DEC UNIX reports back the
exact size I set.

Looking at the code it seems that the *2 should not be there:

>From /usr/src/linux/net/core/sock.c:

int sock_setsockopt(...

                case SO_SNDBUF:

                        sk->sndbuf = max(val*2,SOCK_MIN_SNDBUF);

                case SO_RCVBUF:
                        /* FIXME: is this lower bound the right one? */
                        sk->rcvbuf = max(val*2,SOCK_MIN_RCVBUF);

Manfred Bartz
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Tue Aug 07 2001 - 21:00:19 EST