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>
This commit is contained in:
Sowmini Varadhan
2015-08-05 01:43:25 -04:00
committed by David S. Miller
parent 1ebd08a7e5
commit d5a8ac28a7
12 changed files with 59 additions and 27 deletions

View File

@@ -189,9 +189,9 @@ out:
spin_unlock_irqrestore(&rds_tcp_tc_list_lock, flags);
}
static int rds_tcp_laddr_check(__be32 addr)
static int rds_tcp_laddr_check(struct net *net, __be32 addr)
{
if (inet_addr_type(&init_net, addr) == RTN_LOCAL)
if (inet_addr_type(net, addr) == RTN_LOCAL)
return 0;
return -EADDRNOTAVAIL;
}