On Thu, 2014-08-21 at 18:19 +0200, Jiri Pirko wrote:
[...]
> --- a/net/dsa/slave.c
> +++ b/net/dsa/slave.c
> @@ -171,6 +171,19 @@ static int dsa_slave_ioctl(struct net_device *dev, 
> struct ifreq *ifr, int cmd)
>       return -EOPNOTSUPP;
>  }
>  
> +static int dsa_slave_swdev_get_id(struct net_device *dev,
> +                               struct netdev_phys_item_id *psid)
> +{
> +     struct dsa_slave_priv *p = netdev_priv(dev);
> +     struct dsa_switch *ds = p->parent;
> +     u64 tmp = (u64) ds;
> +
> +     /* TODO: add more sophisticated id generation */
> +     memcpy(&psid->id, &tmp, sizeof(tmp));
[...]

Right, you must not expose kernel addresses to userland.

Ben.

-- 
Ben Hutchings
If at first you don't succeed, you're doing about average.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to