]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/core/sock.c
[GFS2] Tidy up Makefile & Kconfig
[linux-2.6-omap-h63xx.git] / net / core / sock.c
index a96ea7dd0fc1b4f6bf2bd092b44218c92c384244..ed2afdb9ea2df7317794e31a1f034a605e0d9c7d 100644 (file)
@@ -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