Message ID | 20221003105204.3315337-9-jiri@resnulli.us (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | net: fix netdev to devlink_port linkage and expose to user | expand |
diff --git a/net/core/devlink.c b/net/core/devlink.c index f119ac43c50d..b5a452bec313 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c @@ -1305,10 +1305,9 @@ static int devlink_nl_port_fill(struct sk_buff *msg, devlink_port->desired_type)) goto nla_put_failure_type_locked; 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; - if (netdev && net_eq(net, dev_net(netdev)) && + if (netdev && (nla_put_u32(msg, DEVLINK_ATTR_PORT_NETDEV_IFINDEX, netdev->ifindex) || nla_put_string(msg, DEVLINK_ATTR_PORT_NETDEV_NAME,