diff options
author | Patrick McManus <mcmanus@ducksong.com> | 2008-03-21 19:33:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-03-21 19:33:01 -0400 |
commit | ec3c0982a2dd1e671bad8e9d26c28dcba0039d87 (patch) | |
tree | 11a3cd7c530e4225a4c3d4c3f3cc54eb7d2e0e4f /net/ipv4/tcp_ipv4.c | |
parent | e4c78840284f3f51b1896cf3936d60a6033c4d2c (diff) |
[TCP]: TCP_DEFER_ACCEPT updates - process as established
Change TCP_DEFER_ACCEPT implementation so that it transitions a
connection to ESTABLISHED after handshake is complete instead of
leaving it in SYN-RECV until some data arrvies. Place connection in
accept queue when first data packet arrives from slow path.
Benefits:
- established connection is now reset if it never makes it
to the accept queue
- diagnostic state of established matches with the packet traces
showing completed handshake
- TCP_DEFER_ACCEPT timeouts are expressed in seconds and can now be
enforced with reasonable accuracy instead of rounding up to next
exponential back-off of syn-ack retry.
Signed-off-by: Patrick McManus <mcmanus@ducksong.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 0ba6e911c979..167a0f557531 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1920,6 +1920,14 @@ int tcp_v4_destroy_sock(struct sock *sk) | |||
1920 | sk->sk_sndmsg_page = NULL; | 1920 | sk->sk_sndmsg_page = NULL; |
1921 | } | 1921 | } |
1922 | 1922 | ||
1923 | if (tp->defer_tcp_accept.request) { | ||
1924 | reqsk_free(tp->defer_tcp_accept.request); | ||
1925 | sock_put(tp->defer_tcp_accept.listen_sk); | ||
1926 | sock_put(sk); | ||
1927 | tp->defer_tcp_accept.listen_sk = NULL; | ||
1928 | tp->defer_tcp_accept.request = NULL; | ||
1929 | } | ||
1930 | |||
1923 | atomic_dec(&tcp_sockets_allocated); | 1931 | atomic_dec(&tcp_sockets_allocated); |
1924 | 1932 | ||
1925 | return 0; | 1933 | return 0; |