diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-31 12:52:30 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-31 12:52:30 -0800 |
commit | 4b75679f60d0ce780609cbff249769b669f4fb69 (patch) | |
tree | 2c8890020b5e7d340036acb01f73a6e53feb038d /net/core/sock.c | |
parent | 30c14e40ed85469f166b5effdab6705c73c5cd5e (diff) | |
parent | 025be81e83043f20538dcced1e12c5f8d152fbdb (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
[NET]: Allow skb headroom to be overridden
[TCP]: Kill unused extern decl for tcp_v4_hash_connecting()
[NET]: add SO_RCVBUF comment
[NET]: Deinline some larger functions from netdevice.h
[DCCP]: Use NULL for pointers, comfort sparse.
[DECNET]: Fix refcount
Diffstat (limited to 'net/core/sock.c')
-rw-r--r-- | net/core/sock.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index a96ea7dd0fc1..ed2afdb9ea2d 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -385,7 +385,21 @@ set_sndbuf: val = sysctl_rmem_max; set_rcvbuf: sk->sk_userlocks |= SOCK_RCVBUF_LOCK; - /* FIXME: is this lower bound the right one? */ + /* + * We double it on the way in to account for + * "struct sk_buff" etc. overhead. Applications + * assume that the SO_RCVBUF setting they make will + * allow that much actual data to be received on that + * socket. + * + * Applications are unaware that "struct sk_buff" and + * other overheads allocate from the receive buffer + * during socket buffer allocation. + * + * And after considering the possible alternatives, + * returning the value we actually used in getsockopt + * is the most desirable behavior. + */ if ((val * 2) < SOCK_MIN_RCVBUF) sk->sk_rcvbuf = SOCK_MIN_RCVBUF; else |