]> git.baikalelectronics.ru Git - kernel.git/commit
[TCP]: Process linger2 timeout consistently.
authorDavid S. Miller <davem@sunset.davemloft.net>
Tue, 1 Aug 2006 05:32:09 +0000 (22:32 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 2 Aug 2006 20:38:24 +0000 (13:38 -0700)
commita05a9f2e7402ac9a3726d208846a94cc3c7605e0
treeeb097a1c4150ff00a66a692f378ea4fb6f1035f0
parente4ddc644e40b6336bd667152be9fa40aa5c8442a
[TCP]: Process linger2 timeout consistently.

Based upon guidance from Alexey Kuznetsov.

When linger2 is active, we check to see if the fin_wait2
timeout is longer than the timewait.  If it is, we schedule
the keepalive timer for the difference between the timewait
timeout and the fin_wait2 timeout.

When this orphan socket is seen by tcp_keepalive_timer()
it will try to transform this fin_wait2 socket into a
fin_wait2 mini-socket, again if linger2 is active.

Not all paths were setting this initial keepalive timer correctly.
The tcp input path was doing it correctly, but tcp_close() wasn't,
potentially making the socket linger longer than it really needs to.

Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp.c