RDMA/core: Avoid copying ifindex twice
rdma_copy_addr copies the ifndex to bound_dev_if. Therefore avoid copying it again after rdma_copy_addr call is completed. Signed-off-by: Parav Pandit <parav@mellanox.com> Reviewed-by: Moni Shoua <monis@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
parent
575c7e583e
commit
5092d17a39
|
@ -265,7 +265,6 @@ int rdma_translate_ip(const struct sockaddr *addr,
|
||||||
return -EADDRNOTAVAIL;
|
return -EADDRNOTAVAIL;
|
||||||
|
|
||||||
rdma_copy_addr(dev_addr, dev, NULL);
|
rdma_copy_addr(dev_addr, dev, NULL);
|
||||||
dev_addr->bound_dev_if = dev->ifindex;
|
|
||||||
dev_put(dev);
|
dev_put(dev);
|
||||||
break;
|
break;
|
||||||
#if IS_ENABLED(CONFIG_IPV6)
|
#if IS_ENABLED(CONFIG_IPV6)
|
||||||
|
@ -276,7 +275,6 @@ int rdma_translate_ip(const struct sockaddr *addr,
|
||||||
&((const struct sockaddr_in6 *)addr)->sin6_addr,
|
&((const struct sockaddr_in6 *)addr)->sin6_addr,
|
||||||
dev, 1)) {
|
dev, 1)) {
|
||||||
rdma_copy_addr(dev_addr, dev, NULL);
|
rdma_copy_addr(dev_addr, dev, NULL);
|
||||||
dev_addr->bound_dev_if = dev->ifindex;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue