Commit d0f51726 authored by Jiri Pirko's avatar Jiri Pirko Committed by Jakub Kicinski

net: devlink: remove net namespace check from devlink_nl_port_fill()

It is ensured by the netdevice notifier event processing, that only
netdev pointers from the same net namespaces are filled. Remove the
net namespace check from devlink_nl_port_fill() as it is no longer
needed.
Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent c8096578
...@@ -1305,10 +1305,9 @@ static int devlink_nl_port_fill(struct sk_buff *msg, ...@@ -1305,10 +1305,9 @@ static int devlink_nl_port_fill(struct sk_buff *msg,
devlink_port->desired_type)) devlink_port->desired_type))
goto nla_put_failure_type_locked; goto nla_put_failure_type_locked;
if (devlink_port->type == DEVLINK_PORT_TYPE_ETH) { if (devlink_port->type == DEVLINK_PORT_TYPE_ETH) {
struct net *net = devlink_net(devlink_port->devlink);
struct net_device *netdev = devlink_port->type_eth.netdev; struct net_device *netdev = devlink_port->type_eth.netdev;
if (netdev && net_eq(net, dev_net(netdev)) && if (netdev &&
(nla_put_u32(msg, DEVLINK_ATTR_PORT_NETDEV_IFINDEX, (nla_put_u32(msg, DEVLINK_ATTR_PORT_NETDEV_IFINDEX,
netdev->ifindex) || netdev->ifindex) ||
nla_put_string(msg, DEVLINK_ATTR_PORT_NETDEV_NAME, nla_put_string(msg, DEVLINK_ATTR_PORT_NETDEV_NAME,
......
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