summaryrefslogtreecommitdiff
path: root/net/rds/tcp_connect.c
diff options
context:
space:
mode:
authorSowmini Varadhan <sowmini.varadhan@oracle.com>2015-08-05 08:43:25 +0300
committerDavid S. Miller <davem@davemloft.net>2015-08-07 21:29:57 +0300
commitd5a8ac28a7ff2f250d1bedbb6008dd2f6f6f1638 (patch)
tree66efc48335d6e97f76503e8c24e95e06b6a22b56 /net/rds/tcp_connect.c
parent1ebd08a7e5ef6265092eae19a547674733dc1c01 (diff)
downloadlinux-d5a8ac28a7ff2f250d1bedbb6008dd2f6f6f1638.tar.xz
RDS-TCP: Make RDS-TCP work correctly when it is set up in a netns other than init_net
Open the sockets calling sock_create_kern() with the correct struct net pointer, and use that struct net pointer when verifying the address passed to rds_bind(). Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds/tcp_connect.c')
-rw-r--r--net/rds/tcp_connect.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/rds/tcp_connect.c b/net/rds/tcp_connect.c
index 973109c7b8e8..6473b7b377ae 100644
--- a/net/rds/tcp_connect.c
+++ b/net/rds/tcp_connect.c
@@ -79,7 +79,8 @@ int rds_tcp_conn_connect(struct rds_connection *conn)
struct sockaddr_in src, dest;
int ret;
- ret = sock_create(PF_INET, SOCK_STREAM, IPPROTO_TCP, &sock);
+ ret = sock_create_kern(rds_conn_net(conn), PF_INET,
+ SOCK_STREAM, IPPROTO_TCP, &sock);
if (ret < 0)
goto out;