[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1447841538.833901.443067761.28637F38@webmail.messagingengine.com>
Date: Wed, 18 Nov 2015 11:12:18 +0100
From: Hannes Frederic Sowa <hannes@...essinduktion.org>
To: Lorenzo Colitti <lorenzo@...gle.com>, netdev@...r.kernel.org
Cc: edumazet@...gle.com, ek@...gle.com, maze@...gle.com,
dtor@...gle.com
Subject: Re: Add a SOCK_DESTROY operation to close sockets from userspace
Hello,
On Wed, Nov 18, 2015, at 02:43, Lorenzo Colitti wrote:
> This patch series adds the ability for a privileged process to
> destroy sockets belonging to other userspace processes via the
> sock_diag interface, and implements that for TCP sockets.
>
> This functionality is needed on laptops and mobile hosts to
> ensure that network switches / disconnects do not result in
> applications being blocked for long periods of time (minutes) in
> read or connect calls on TCP sockets that will never succeed
> because the IP address they are bound to is gone. Closing the
> sockets in the protocol layer causes these calls to fail fast and
> allows applications to reconnect on another network.
I regularly do this with gdb, connecting to the process, looking up the
filedescriptors in /proc/pid/fd and closing the socket. Actually it will
also be removed from the poll tables and thus unlocks the system. I
think a user space approach would be preferred to do so, or some out of
band signalling (which we actually already have in terms of netlink
monitor).
Bye,
Hannes
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists