Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 289736
b: refs/heads/master
c: 02b6195
h: refs/heads/master
v: v3
  • Loading branch information
David Miller committed Jan 26, 2012
1 parent 2eb4ae1 commit f4dcb93
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9b28ecd66b391349d3492574500f978566195454
refs/heads/master: 02b619555ad68884bacfbe41893245394cb44885
14 changes: 9 additions & 5 deletions trunk/drivers/infiniband/core/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,22 +178,26 @@ static void queue_req(struct addr_req *req)
mutex_unlock(&lock);
}

static int dst_fetch_ha(struct dst_entry *dst, struct rdma_dev_addr *addr)
static int dst_fetch_ha(struct dst_entry *dst, struct rdma_dev_addr *dev_addr, void *daddr)
{
struct neighbour *n;
int ret;

n = dst_neigh_lookup(dst, daddr);

rcu_read_lock();
n = dst_get_neighbour_noref(dst);
if (!n || !(n->nud_state & NUD_VALID)) {
if (n)
neigh_event_send(n, NULL);
ret = -ENODATA;
} else {
ret = rdma_copy_addr(addr, dst->dev, n->ha);
ret = rdma_copy_addr(dev_addr, dst->dev, n->ha);
}
rcu_read_unlock();

if (n)
neigh_release(n);

return ret;
}

Expand Down Expand Up @@ -232,7 +236,7 @@ static int addr4_resolve(struct sockaddr_in *src_in,
goto put;
}

ret = dst_fetch_ha(&rt->dst, addr);
ret = dst_fetch_ha(&rt->dst, addr, &fl4.daddr);
put:
ip_rt_put(rt);
out:
Expand Down Expand Up @@ -280,7 +284,7 @@ static int addr6_resolve(struct sockaddr_in6 *src_in,
goto put;
}

ret = dst_fetch_ha(dst, addr);
ret = dst_fetch_ha(dst, addr, &fl6.daddr);
put:
dst_release(dst);
return ret;
Expand Down

0 comments on commit f4dcb93

Please sign in to comment.