diff options
author | Sowmini Varadhan <sowmini.varadhan@oracle.com> | 2015-08-05 01:43:25 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-08-07 11:29:57 -0700 |
commit | d5a8ac28a7ff2f250d1bedbb6008dd2f6f6f1638 (patch) | |
tree | 66efc48335d6e97f76503e8c24e95e06b6a22b56 /net/rds/transport.c | |
parent | 1ebd08a7e5ef6265092eae19a547674733dc1c01 (diff) | |
download | linux-stable-d5a8ac28a7ff2f250d1bedbb6008dd2f6f6f1638.tar.gz linux-stable-d5a8ac28a7ff2f250d1bedbb6008dd2f6f6f1638.tar.bz2 linux-stable-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/transport.c')
-rw-r--r-- | net/rds/transport.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/rds/transport.c b/net/rds/transport.c index 83498e1c75b8..f3afd1d60d3c 100644 --- a/net/rds/transport.c +++ b/net/rds/transport.c @@ -77,7 +77,7 @@ void rds_trans_put(struct rds_transport *trans) module_put(trans->t_owner); } -struct rds_transport *rds_trans_get_preferred(__be32 addr) +struct rds_transport *rds_trans_get_preferred(struct net *net, __be32 addr) { struct rds_transport *ret = NULL; struct rds_transport *trans; @@ -90,7 +90,7 @@ struct rds_transport *rds_trans_get_preferred(__be32 addr) for (i = 0; i < RDS_TRANS_COUNT; i++) { trans = transports[i]; - if (trans && (trans->laddr_check(addr) == 0) && + if (trans && (trans->laddr_check(net, addr) == 0) && (!trans->t_owner || try_module_get(trans->t_owner))) { ret = trans; break; |