aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/verbs.c
diff options
context:
space:
mode:
authorMoni Shoua <monis@mellanox.com>2017-05-23 10:48:45 +0300
committerDoug Ledford <dledford@redhat.com>2017-07-17 11:45:42 -0400
commitcbd09aebc2d62095b05797af5c9a315e3a71dcea (patch)
treeb8b7eed2c10d5b8901891348ce80a57027cc5dd5 /drivers/infiniband/core/verbs.c
parentIB/core: Namespace is mandatory input for address resolution (diff)
downloadlinux-dev-cbd09aebc2d62095b05797af5c9a315e3a71dcea.tar.xz
linux-dev-cbd09aebc2d62095b05797af5c9a315e3a71dcea.zip
IB/core: Don't resolve IP address to the loopback device
When resolving an IP address that is on the host of the caller the result from querying the routing table is the loopback device. This is not a valid response, because it doesn't represent the RDMA device and the port. Therefore, callers need to check the resolved device and if it is a loopback device find an alternative way to resolve it. To avoid this we make sure that the response from rdma_resolve_ip() will not be the loopback device. While that, we fix an static checker warning about dereferencing an unintitialized pointer using the same solution as in commit abeffce90c7f ("net/mlx5e: Fix a -Wmaybe-uninitialized warning") as a reference. 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/verbs.c')
-rw-r--r--drivers/infiniband/core/verbs.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index 47ee1f83c9a9..644fa0d13f02 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -520,11 +520,6 @@ int ib_init_ah_from_wc(struct ib_device *device, u8 port_num,
}
resolved_dev = dev_get_by_index(&init_net, if_index);
- if (resolved_dev->flags & IFF_LOOPBACK) {
- dev_put(resolved_dev);
- resolved_dev = idev;
- dev_hold(resolved_dev);
- }
rcu_read_lock();
if (resolved_dev != idev && !rdma_is_upper_dev_rcu(idev,
resolved_dev))