Commit 61c37028 authored by Mark Bloch's avatar Mark Bloch Committed by Doug Ledford
Browse files

IB/core: Add missing check for addr_resolve callback return value

When calling rdma_resolve_ip inside rdma_addr_find_l2_eth_by_grh,
the return status of the request was ignored in the callback function
causing a successful return and an empty dmac.
Signed-off-by: default avatarMark Bloch <>
Signed-off-by: default avatarAlex Vesker <>
Reviewed-by: default avatarOr Gerlitz <>
Signed-off-by: default avatarLeon Romanovsky <>
Signed-off-by: default avatarDoug Ledford <>
parent aeb76df4
......@@ -699,13 +699,16 @@ EXPORT_SYMBOL(rdma_addr_cancel);
struct resolve_cb_context {
struct rdma_dev_addr *addr;
struct completion comp;
int status;
static void resolve_cb(int status, struct sockaddr *src_addr,
struct rdma_dev_addr *addr, void *context)
memcpy(((struct resolve_cb_context *)context)->addr, addr, sizeof(struct
if (!status)
memcpy(((struct resolve_cb_context *)context)->addr,
addr, sizeof(struct rdma_dev_addr));
((struct resolve_cb_context *)context)->status = status;
complete(&((struct resolve_cb_context *)context)->comp);
......@@ -743,6 +746,10 @@ int rdma_addr_find_l2_eth_by_grh(const union ib_gid *sgid,
ret = ctx.status;
if (ret)
return ret;
memcpy(dmac, dev_addr.dst_dev_addr, ETH_ALEN);
dev = dev_get_by_index(&init_net, dev_addr.bound_dev_if);
if (!dev)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment