Re: Bug? TCP shutdown behaviour when deleting local IP addresses
flat view
From: Alexey Kuznetsov <hidden>
Date: 2012-10-18 10:02:06
On Thu, Oct 18, 2012 at 11:13:29AM +0200, Eric Dumazet wrote:
quoted
c) tell the kernel to kill all TCP sessions bound to a certain IP, because the connection manager is going to remove it shortly. Send TCP RSTs or whatever and close the TCP session, so both ends know that network connectivity is going down.Yes, why not.
FYI the idea was by Andi Kleen back in 2003. If was flag IFF_DYNAMIC on device (apparently, it should be per-interface sysctl instead or even a flag on specific address). 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. 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.