Re: Bug? TCP shutdown behaviour when deleting local IP addresses
flat view
From: Mikael Abrahamsson <hidden>
Date: 2012-10-18 10:10:44
On Thu, 18 Oct 2012, Alexey Kuznetsov wrote:
Andi suggested to hook netdev notifier and to reset tcp connections bound to addresses on this interface. He did not go so far to send resets before address is actually disabled (it was not a goal, normally address is already dead to the time when it is deleted), but techically it is the same.
With IPv6 and temporary addresses etc, and DHCPv4/v6 leases expiring, addresses going away can be a quite foreseeable event. When I suspend my laptop, the IP going away is also quite forseeable.
The problem with this was purely technical, the code has to scan through all the tcp hash table to search for connections to this address (grrr already :-)) and to take socket lock before making any actions. It is doable, but quite chumbersome and nobody was interested enough to finish the job.
Are there hooks so that someone could write a userland application to do this job? I could imagine the connection manager doing this job as well (so it's configurable what connection to close or not). What about the reset of the TCP retransmit timers, is that doable from userland? Or at least lowering them to 1s or something fairly sane (going to fast-retransmit doesn't make sense, neither does having a retransmit timer in the 10s of minutes). Btw, what are the TCP retransmit timers when I come out of suspend? The machine has been "offline" for hours, what idea does TCP have of what's going on, will it keep the timers it had when machine went down or does TCP believe it hasn't seen a response for a long time and now the retransmit timers are very high? -- Mikael Abrahamsson email: swmike@swm.pp.se