diff options
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/core/addr.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c index 4ffc224faa7f..8e21d457b899 100644 --- a/drivers/infiniband/core/addr.c +++ b/drivers/infiniband/core/addr.c | |||
@@ -185,15 +185,20 @@ static int addr4_resolve(struct sockaddr_in *src_in, | |||
185 | __be32 dst_ip = dst_in->sin_addr.s_addr; | 185 | __be32 dst_ip = dst_in->sin_addr.s_addr; |
186 | struct rtable *rt; | 186 | struct rtable *rt; |
187 | struct neighbour *neigh; | 187 | struct neighbour *neigh; |
188 | struct flowi4 fl4; | ||
188 | int ret; | 189 | int ret; |
189 | 190 | ||
190 | rt = ip_route_output(&init_net, dst_ip, src_ip, 0, addr->bound_dev_if); | 191 | memset(&fl4, 0, sizeof(fl4)); |
192 | fl4.daddr = dst_ip; | ||
193 | fl4.saddr = src_ip; | ||
194 | fl4.flowi4_oif = addr->bound_dev_if; | ||
195 | rt = ip_route_output_key(&init_net, &fl4); | ||
191 | if (IS_ERR(rt)) { | 196 | if (IS_ERR(rt)) { |
192 | ret = PTR_ERR(rt); | 197 | ret = PTR_ERR(rt); |
193 | goto out; | 198 | goto out; |
194 | } | 199 | } |
195 | src_in->sin_family = AF_INET; | 200 | src_in->sin_family = AF_INET; |
196 | src_in->sin_addr.s_addr = rt->rt_src; | 201 | src_in->sin_addr.s_addr = fl4.saddr; |
197 | 202 | ||
198 | if (rt->dst.dev->flags & IFF_LOOPBACK) { | 203 | if (rt->dst.dev->flags & IFF_LOOPBACK) { |
199 | ret = rdma_translate_ip((struct sockaddr *) dst_in, addr); | 204 | ret = rdma_translate_ip((struct sockaddr *) dst_in, addr); |