diff options
author | Moni Shoua <monis@mellanox.com> | 2017-05-23 10:48:44 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-07-17 11:45:34 -0400 |
commit | bebb2a473a43c8f84a8210687d1cbdde503046d7 (patch) | |
tree | 39eab06ae863eae1ceb6a35aec02c065da35dfa5 /drivers/infiniband/core/addr.c | |
parent | c8c16d3bae967f1c7af541e8d016e5c51e4f010a (diff) | |
download | blackbird-op-linux-bebb2a473a43c8f84a8210687d1cbdde503046d7.tar.gz blackbird-op-linux-bebb2a473a43c8f84a8210687d1cbdde503046d7.zip |
IB/core: Namespace is mandatory input for address resolution
In function addr_resolve() the namespace is a required input parameter
and not an output. It is passed later for searching the routing table
and device addresses. Also, it shouldn't be copied back to the caller.
Fixes: 565edd1d5555 ('IB/addr: Pass network namespace as a parameter')
Cc: <stable@vger.kernel.org> # v4.3+
Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/core/addr.c')
-rw-r--r-- | drivers/infiniband/core/addr.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c index a6cb379a4ebc..d78bc74bc9a9 100644 --- a/drivers/infiniband/core/addr.c +++ b/drivers/infiniband/core/addr.c @@ -509,6 +509,11 @@ static int addr_resolve(struct sockaddr *src_in, struct dst_entry *dst; int ret; + if (!addr->net) { + pr_warn_ratelimited("%s: missing namespace\n", __func__); + return -EINVAL; + } + if (src_in->sa_family == AF_INET) { struct rtable *rt = NULL; const struct sockaddr_in *dst_in4 = @@ -546,7 +551,6 @@ static int addr_resolve(struct sockaddr *src_in, } addr->bound_dev_if = ndev->ifindex; - addr->net = dev_net(ndev); dev_put(ndev); return ret; |