From 66c74d746db127152fadb33f75b2a8ffa4a02b27 Mon Sep 17 00:00:00 2001 From: Parav Pandit Date: Tue, 9 Jan 2018 15:58:56 +0200 Subject: [PATCH] RDMA/cma: Update cma_validate_port to honor net namespace cma_validate_port uses rdma_dev_addr to validate the port of the cm_id. It needs to honor the net namespace which is setup during cm_id creation when finding netdevice. Signed-off-by: Parav Pandit Reviewed-by: Mark Bloch Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe --- drivers/infiniband/core/cma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index 575ee4676252..2784512f597f 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -628,7 +628,7 @@ static inline int cma_validate_port(struct ib_device *device, u8 port, return ret; if (dev_type == ARPHRD_ETHER && rdma_protocol_roce(device, port)) { - ndev = dev_get_by_index(&init_net, bound_if_index); + ndev = dev_get_by_index(dev_addr->net, bound_if_index); if (!ndev) return ret; } else { -- 2.11.0