diff options
author | David S. Miller <davem@davemloft.net> | 2008-06-13 23:52:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-06-13 23:52:39 -0400 |
commit | 4ae127d1b6c71f9240dd4245f240e6dd8fc98014 (patch) | |
tree | b7aa27b3e0c655f4613fe2146cb57d7f69e421f6 /net/ipv4/tcp.c | |
parent | 875ec4333b99144e2589e900a0bcd2c25c757b27 (diff) | |
parent | 7775c9753b94fe429dc4323360d6502c95e0dd6e (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/smc911x.c
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r-- | net/ipv4/tcp.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 6d30ca559c64..cf0850c068f5 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -2110,12 +2110,15 @@ static int do_tcp_setsockopt(struct sock *sk, int level, | |||
2110 | break; | 2110 | break; |
2111 | 2111 | ||
2112 | case TCP_DEFER_ACCEPT: | 2112 | case TCP_DEFER_ACCEPT: |
2113 | if (val < 0) { | 2113 | icsk->icsk_accept_queue.rskq_defer_accept = 0; |
2114 | err = -EINVAL; | 2114 | if (val > 0) { |
2115 | } else { | 2115 | /* Translate value in seconds to number of |
2116 | if (val > MAX_TCP_ACCEPT_DEFERRED) | 2116 | * retransmits */ |
2117 | val = MAX_TCP_ACCEPT_DEFERRED; | 2117 | while (icsk->icsk_accept_queue.rskq_defer_accept < 32 && |
2118 | icsk->icsk_accept_queue.rskq_defer_accept = val; | 2118 | val > ((TCP_TIMEOUT_INIT / HZ) << |
2119 | icsk->icsk_accept_queue.rskq_defer_accept)) | ||
2120 | icsk->icsk_accept_queue.rskq_defer_accept++; | ||
2121 | icsk->icsk_accept_queue.rskq_defer_accept++; | ||
2119 | } | 2122 | } |
2120 | break; | 2123 | break; |
2121 | 2124 | ||
@@ -2297,7 +2300,8 @@ static int do_tcp_getsockopt(struct sock *sk, int level, | |||
2297 | val = (val ? : sysctl_tcp_fin_timeout) / HZ; | 2300 | val = (val ? : sysctl_tcp_fin_timeout) / HZ; |
2298 | break; | 2301 | break; |
2299 | case TCP_DEFER_ACCEPT: | 2302 | case TCP_DEFER_ACCEPT: |
2300 | val = icsk->icsk_accept_queue.rskq_defer_accept; | 2303 | val = !icsk->icsk_accept_queue.rskq_defer_accept ? 0 : |
2304 | ((TCP_TIMEOUT_INIT / HZ) << (icsk->icsk_accept_queue.rskq_defer_accept - 1)); | ||
2301 | break; | 2305 | break; |
2302 | case TCP_WINDOW_CLAMP: | 2306 | case TCP_WINDOW_CLAMP: |
2303 | val = tp->window_clamp; | 2307 | val = tp->window_clamp; |