mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
IB/core: Namespace is mandatory input for address resolution
commitbebb2a473aupstream. In function addr_resolve() the namespace is a required input parameter and not an output. It is passed later for searching the routing table and device addresses. Also, it shouldn't be copied back to the caller. Fixes:565edd1d55('IB/addr: Pass network namespace as a parameter') Signed-off-by: Moni Shoua <monis@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Doug Ledford <dledford@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
5c2717f415
commit
dd0d6509cb
@@ -518,6 +518,11 @@ static int addr_resolve(struct sockaddr *src_in,
|
||||
struct dst_entry *dst;
|
||||
int ret;
|
||||
|
||||
if (!addr->net) {
|
||||
pr_warn_ratelimited("%s: missing namespace\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (src_in->sa_family == AF_INET) {
|
||||
struct rtable *rt = NULL;
|
||||
const struct sockaddr_in *dst_in4 =
|
||||
@@ -555,7 +560,6 @@ static int addr_resolve(struct sockaddr *src_in,
|
||||
}
|
||||
|
||||
addr->bound_dev_if = ndev->ifindex;
|
||||
addr->net = dev_net(ndev);
|
||||
dev_put(ndev);
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user