summaryrefslogtreecommitdiffstats
path: root/net/rds/bind.c
diff options
context:
space:
mode:
authorSowmini Varadhan <sowmini.varadhan@oracle.com>2015-08-05 07:43:25 +0200
committerDavid S. Miller <davem@davemloft.net>2015-08-07 20:29:57 +0200
commitd5a8ac28a7ff2f250d1bedbb6008dd2f6f6f1638 (patch)
tree66efc48335d6e97f76503e8c24e95e06b6a22b56 /net/rds/bind.c
parentMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsh... (diff)
downloadlinux-d5a8ac28a7ff2f250d1bedbb6008dd2f6f6f1638.tar.xz
linux-d5a8ac28a7ff2f250d1bedbb6008dd2f6f6f1638.zip
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/bind.c')
-rw-r--r--net/rds/bind.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/rds/bind.c b/net/rds/bind.c
index 4ebd29c128b6..dd666fb9b4e1 100644
--- a/net/rds/bind.c
+++ b/net/rds/bind.c
@@ -185,7 +185,8 @@ int rds_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
ret = 0;
goto out;
}
- trans = rds_trans_get_preferred(sin->sin_addr.s_addr);
+ trans = rds_trans_get_preferred(sock_net(sock->sk),
+ sin->sin_addr.s_addr);
if (!trans) {
ret = -EADDRNOTAVAIL;
rds_remove_bound(rs);