alistair23-linux/net/ipv4
Hagen Paul Pfeifer e88c64f0a4 tcp: allow effective reduction of TCP's rcv-buffer via setsockopt
Via setsockopt it is possible to reduce the socket RX buffer
(SO_RCVBUF). TCP method to select the initial window and window scaling
option in tcp_select_initial_window() currently misbehaves and do not
consider a reduced RX socket buffer via setsockopt.

Even though the server's RX buffer is reduced via setsockopt() to 256
byte (Initial Window 384 byte => 256 * 2 - (256 * 2 / 4)) the window
scale option is still 7:

192.168.1.38.40676 > 78.47.222.210.5001: Flags [S], seq 2577214362, win 5840, options [mss 1460,sackOK,TS val 338417 ecr 0,nop,wscale 0], length 0
78.47.222.210.5001 > 192.168.1.38.40676: Flags [S.], seq 1570631029, ack 2577214363, win 384, options [mss 1452,sackOK,TS val 2435248895 ecr 338417,nop,wscale 7], length 0
192.168.1.38.40676 > 78.47.222.210.5001: Flags [.], ack 1, win 5840, options [nop,nop,TS val 338421 ecr 2435248895], length 0

Within tcp_select_initial_window() the original space argument - a
representation of the rx buffer size - is expanded during
tcp_select_initial_window(). Only sysctl_tcp_rmem[2], sysctl_rmem_max
and window_clamp are considered to calculate the initial window.

This patch adjust the window_clamp argument if the user explicitly
reduce the receive buffer.

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
Cc: David S. Miller <davem@davemloft.net>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-08-22 21:42:54 -07:00
..
netfilter Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2010-08-21 23:32:24 -07:00
af_inet.c net: build_ehash_secret() and rt_bind_peer() cleanups 2010-08-20 00:50:16 -07:00
ah4.c
arp.c net/ipv4: EXPORT_SYMBOL cleanups 2010-07-12 12:57:54 -07:00
cipso_ipv4.c net: Remove unnecessary returns from void function()s 2010-05-17 23:23:14 -07:00
datagram.c net/ipv4: EXPORT_SYMBOL cleanups 2010-07-12 12:57:54 -07:00
devinet.c arp_notify: allow drivers to explicitly request a notification event. 2010-05-31 00:27:44 -07:00
esp4.c
fib_frontend.c net/ipv4: EXPORT_SYMBOL cleanups 2010-07-12 12:57:54 -07:00
fib_hash.c
fib_lookup.h
fib_rules.c
fib_semantics.c
fib_trie.c net: Remove unnecessary returns from void function()s 2010-05-17 23:23:14 -07:00
gre.c PPTP: PPP over IPv4 (Point-to-Point Tunneling Protocol) 2010-08-21 23:05:39 -07:00
icmp.c net: simplify flags for tx timestamping 2010-08-19 00:08:30 -07:00
igmp.c net/ipv4: EXPORT_SYMBOL cleanups 2010-07-12 12:57:54 -07:00
inet_connection_sock.c net/ipv4: EXPORT_SYMBOL cleanups 2010-07-12 12:57:54 -07:00
inet_diag.c
inet_fragment.c net/ipv4: EXPORT_SYMBOL cleanups 2010-07-12 12:57:54 -07:00
inet_hashtables.c net/ipv4: EXPORT_SYMBOL cleanups 2010-07-12 12:57:54 -07:00
inet_lro.c
inet_timewait_sock.c
inetpeer.c inetpeer: restore small inet_peer structures 2010-06-16 11:55:39 -07:00
ip_forward.c net-next: remove useless union keyword 2010-06-10 23:31:35 -07:00
ip_fragment.c net/ipv4: EXPORT_SYMBOL cleanups 2010-07-12 12:57:54 -07:00
ip_gre.c PPTP: PPP over IPv4 (Point-to-Point Tunneling Protocol) 2010-08-21 23:05:39 -07:00
ip_input.c net: use this_cpu_ptr() 2010-06-28 23:24:29 -07:00
ip_options.c net: Remove unnecessary returns from void function()s 2010-05-17 23:23:14 -07:00
ip_output.c net: simplify flags for tx timestamping 2010-08-19 00:08:30 -07:00
ip_sockglue.c net - IP_NODEFRAG option for IPv4 socket 2010-06-23 13:16:38 -07:00
ipcomp.c
ipconfig.c ipconfig: send host-name in DHCP requests 2010-06-02 07:05:03 -07:00
ipip.c net-next: remove useless union keyword 2010-06-10 23:31:35 -07:00
ipmr.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2010-07-20 18:25:24 -07:00
Kconfig PPTP: PPP over IPv4 (Point-to-Point Tunneling Protocol) 2010-08-21 23:05:39 -07:00
Makefile PPTP: PPP over IPv4 (Point-to-Point Tunneling Protocol) 2010-08-21 23:05:39 -07:00
netfilter.c Merge branch 'master' of /repos/git/net-next-2.6 2010-06-15 17:31:06 +02:00
proc.c snmp: 64bit ipstats_mib for all arches 2010-06-30 13:31:19 -07:00
protocol.c net/ipv4: EXPORT_SYMBOL cleanups 2010-07-12 12:57:54 -07:00
raw.c net: simplify flags for tx timestamping 2010-08-19 00:08:30 -07:00
route.c net: build_ehash_secret() and rt_bind_peer() cleanups 2010-08-20 00:50:16 -07:00
syncookies.c syncookies: add support for ECN 2010-06-26 22:00:03 -07:00
sysctl_net_ipv4.c net: reserve ports for applications using fixed port numbers 2010-05-15 23:28:40 -07:00
tcp.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2010-08-02 22:22:46 -07:00
tcp_bic.c
tcp_cong.c
tcp_cubic.c
tcp_diag.c
tcp_highspeed.c
tcp_htcp.c
tcp_hybla.c TCP: tcp_hybla: Fix integer overflow in slow start increment 2010-06-02 07:15:48 -07:00
tcp_illinois.c
tcp_input.c tcp: no md5sig option size check bug 2010-08-07 20:24:28 -07:00
tcp_ipv4.c inet, inet6: make tcp_sendmsg() and tcp_sendpage() through inet_sendmsg() and inet_sendpage() 2010-07-12 20:21:46 -07:00
tcp_lp.c
tcp_minisocks.c net/ipv4: EXPORT_SYMBOL cleanups 2010-07-12 12:57:54 -07:00
tcp_output.c tcp: allow effective reduction of TCP's rcv-buffer via setsockopt 2010-08-22 21:42:54 -07:00
tcp_probe.c
tcp_scalable.c
tcp_timer.c net/ipv4: EXPORT_SYMBOL cleanups 2010-07-12 12:57:54 -07:00
tcp_vegas.c
tcp_vegas.h
tcp_veno.c
tcp_westwood.c
tcp_yeah.c
tunnel4.c net/ipv4: EXPORT_SYMBOL cleanups 2010-07-12 12:57:54 -07:00
udp.c net: simplify flags for tx timestamping 2010-08-19 00:08:30 -07:00
udp_impl.h
udplite.c net/ipv4: EXPORT_SYMBOL cleanups 2010-07-12 12:57:54 -07:00
xfrm4_input.c net/ipv4: EXPORT_SYMBOL cleanups 2010-07-12 12:57:54 -07:00
xfrm4_mode_beet.c
xfrm4_mode_transport.c
xfrm4_mode_tunnel.c
xfrm4_output.c
xfrm4_policy.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2010-07-07 15:59:38 -07:00
xfrm4_state.c
xfrm4_tunnel.c