Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24959
b: refs/heads/master
c: c08e496
h: refs/heads/master
i:
  24957: 7ea0f56
  24955: bb736eb
  24951: 7c07c0d
  24943: ba2e061
  24927: cb18bfd
  24895: aed9b2c
  24831: f349d84
v: v3
  • Loading branch information
Andrew Morton authored and David S. Miller committed Mar 31, 2006
1 parent 9c33682 commit 45705f4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 56079431b6ba163df8ba26b3eccc82379f0c0ce4
refs/heads/master: c08e49611a8b4e38a75bf217e1029a48faf10b82
16 changes: 15 additions & 1 deletion trunk/net/core/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,21 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
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
Expand Down

0 comments on commit 45705f4

Please sign in to comment.