From 467fa15356acfb7b2efa38839c3e76caa4e6e0ea Mon Sep 17 00:00:00 2001 From: Sowmini Varadhan Date: Wed, 5 Aug 2015 01:43:26 -0400 Subject: RDS-TCP: Support multiple RDS-TCP listen endpoints, one per netns. Register pernet subsys init/stop functions that will set up and tear down per-net RDS-TCP listen endpoints. Unregister pernet subusys functions on 'modprobe -r' to clean up these end points. Enable keepalive on both accept and connect socket endpoints. The keepalive timer expiration will ensure that client socket endpoints will be removed as appropriate from the netns when an interface is removed from a namespace. Register a device notifier callback that will clean up all sockets (and thus avoid the need to wait for keepalive timeout) when the loopback device is unregistered from the netns indicating that the netns is getting deleted. Signed-off-by: Sowmini Varadhan Signed-off-by: David S. Miller --- net/rds/tcp_connect.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'net/rds/tcp_connect.c') diff --git a/net/rds/tcp_connect.c b/net/rds/tcp_connect.c index 6473b7b377ae..5cb16875c460 100644 --- a/net/rds/tcp_connect.c +++ b/net/rds/tcp_connect.c @@ -112,10 +112,12 @@ int rds_tcp_conn_connect(struct rds_connection *conn) rdsdebug("connect to address %pI4 returned %d\n", &conn->c_faddr, ret); if (ret == -EINPROGRESS) ret = 0; - if (ret == 0) + if (ret == 0) { + rds_tcp_keepalive(sock); sock = NULL; - else + } else { rds_tcp_restore_callbacks(sock, conn->c_transport_data); + } out: if (sock) -- cgit v1.2.3