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/inet_connection_sock.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/inet_connection_sock.c')
-rw-r--r-- | net/ipv4/inet_connection_sock.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index 8a45be988709..cc1a1859a61b 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c | |||
@@ -414,8 +414,7 @@ void inet_csk_reqsk_queue_prune(struct sock *parent, | |||
414 | struct inet_connection_sock *icsk = inet_csk(parent); | 414 | struct inet_connection_sock *icsk = inet_csk(parent); |
415 | struct request_sock_queue *queue = &icsk->icsk_accept_queue; | 415 | struct request_sock_queue *queue = &icsk->icsk_accept_queue; |
416 | struct listen_sock *lopt = queue->listen_opt; | 416 | struct listen_sock *lopt = queue->listen_opt; |
417 | int max_retries = icsk->icsk_syn_retries ? : sysctl_tcp_synack_retries; | 417 | int thresh = icsk->icsk_syn_retries ? : sysctl_tcp_synack_retries; |
418 | int thresh = max_retries; | ||
419 | unsigned long now = jiffies; | 418 | unsigned long now = jiffies; |
420 | struct request_sock **reqp, *req; | 419 | struct request_sock **reqp, *req; |
421 | int i, budget; | 420 | int i, budget; |
@@ -451,9 +450,6 @@ void inet_csk_reqsk_queue_prune(struct sock *parent, | |||
451 | } | 450 | } |
452 | } | 451 | } |
453 | 452 | ||
454 | if (queue->rskq_defer_accept) | ||
455 | max_retries = queue->rskq_defer_accept; | ||
456 | |||
457 | budget = 2 * (lopt->nr_table_entries / (timeout / interval)); | 453 | budget = 2 * (lopt->nr_table_entries / (timeout / interval)); |
458 | i = lopt->clock_hand; | 454 | i = lopt->clock_hand; |
459 | 455 | ||
@@ -461,9 +457,8 @@ void inet_csk_reqsk_queue_prune(struct sock *parent, | |||
461 | reqp=&lopt->syn_table[i]; | 457 | reqp=&lopt->syn_table[i]; |
462 | while ((req = *reqp) != NULL) { | 458 | while ((req = *reqp) != NULL) { |
463 | if (time_after_eq(now, req->expires)) { | 459 | if (time_after_eq(now, req->expires)) { |
464 | if ((req->retrans < (inet_rsk(req)->acked ? max_retries : thresh)) && | 460 | if (req->retrans < thresh && |
465 | (inet_rsk(req)->acked || | 461 | !req->rsk_ops->rtx_syn_ack(parent, req)) { |
466 | !req->rsk_ops->rtx_syn_ack(parent, req))) { | ||
467 | unsigned long timeo; | 462 | unsigned long timeo; |
468 | 463 | ||
469 | if (req->retrans++ == 0) | 464 | if (req->retrans++ == 0) |