Bug 73021 - TCP_USER_TIMEOUT not working when interface is taken down, e.g. cable unplugged
Summary: TCP_USER_TIMEOUT not working when interface is taken down, e.g. cable unplugged
Status: NEW
Alias: None
Product: Networking
Classification: Unclassified
Component: IPV4 (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Stephen Hemminger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-27 12:49 UTC by pelle.johnsen
Modified: 2016-02-15 20:13 UTC (History)
3 users (show)

See Also:
Kernel Version: 3.4.24 and 3.11.0
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description pelle.johnsen 2014-03-27 12:49:21 UTC
When the network interface is taken down (in this case eth0 plugging out cable) an established socket goes to zero window probing state (netstat -o shows unkn-4). This state ignores TCP_USER_TIMEOUT (and any keep-alive timeouts) and result is that socket takes ~12 min. to timeout instead of what is specified with TCP_USER_TIMEOUT.

There seems to be 2 'issues':

1. Why does socket go to zero window probing in this case?

2. Why does zero window probing not respect TCP_USER_TIMEOUT?

Expected behavior:

TCP_USER_TIMEOUT can be used to limit how long it takes a socket to timeout.
Comment 1 Yuchung Cheng 2014-03-28 23:10:54 UTC
on issue 2, I guess we should not require any probe is attempted / sent?

diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index 286227a..8f52c40 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -610,8 +610,7 @@ static void tcp_keepalive_timer (unsigned long data)
                 * to determine when to timeout instead.
                 */
                if ((icsk->icsk_user_timeout != 0 &&
-                   elapsed >= icsk->icsk_user_timeout &&
-                   icsk->icsk_probes_out > 0) ||
+                   elapsed >= icsk->icsk_user_timeout) ||
                    (icsk->icsk_user_timeout == 0 &&
                    icsk->icsk_probes_out >= keepalive_probes(tp))) {
                        tcp_send_active_reset(sk, GFP_ATOMIC);
Comment 2 Alan 2014-04-08 10:26:04 UTC
Networking patches should go to netdev@vger.kernel.org with a Signed-off-by: line

See Documentation/SubmittingPatches

Note You need to log in before you can comment on or make changes to this bug.