Re: Linux 2.2.* SO_RCVBUF / SO_SNDBUF annoyance ?

Andi Kleen (ak@muc.de)
20 Sep 1999 00:07:39 +0200


amackay@gusnet.cx (Angus Mackay) writes:

> was there any response to the issue brought up on the list a while ago
> about 2.2.* using 2x the specified value for the SND/RCV buffer?
>
> the offending code is [linux/net/core/sock.c]:
> case SO_SNDBUF:
> if (val > sysctl_wmem_max)
> val = sysctl_wmem_max;
> sk->sndbuf = max(val*2,2048);
>
> this seems pretty retarted to me, is there any reason to give the user twice the
> value they asked for?

Linux counts internal headers in the buffer. BSD does not. This is a heuristic
for compatibility (half of the buffer reserved for headers). To compensate the
TCP window offering is halved.

-Andi

-- 
This is like TV. I don't like TV.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/