Commit 5092d17a authored by Parav Pandit's avatar Parav Pandit Committed by Jason Gunthorpe

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: default avatarParav Pandit <parav@mellanox.com>
Reviewed-by: default avatarMoni Shoua <monis@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 575c7e58
...@@ -265,7 +265,6 @@ int rdma_translate_ip(const struct sockaddr *addr, ...@@ -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, ...@@ -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;
} }
} }
......
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