]> git.baikalelectronics.ru Git - kernel.git/commit
IB/core: Don't resolve IP address to the loopback device
authorMoni Shoua <monis@mellanox.com>
Tue, 23 May 2017 07:48:45 +0000 (10:48 +0300)
committerDoug Ledford <dledford@redhat.com>
Mon, 17 Jul 2017 15:45:42 +0000 (11:45 -0400)
commit1e9c6b2c7216fc7e70b1009c1eaea84de7d64a3b
treeb8b7eed2c10d5b8901891348ce80a57027cc5dd5
parentc716a58de087776ff39256eeded1be070c48204e
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 905c7f9ac870
("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>
drivers/infiniband/core/addr.c
drivers/infiniband/core/cma.c
drivers/infiniband/core/verbs.c