Subject: Re: [RFC VLAN 10/10]: Use rtnl_link API

From: Ben Greear <[email-masked]>
Date: Tue, 05 Jun 2007 14:31:59 -0700

Patrick McHardy wrote:
> [VLAN]: Use rtnl_link API
> 
> Signed-off-by: Patrick McHardy <[email-masked]>

> +static int vlan_newlink(struct net_device *dev,
> +			struct nlattr *tb[], struct nlattr *data[])
> +{
> +	struct vlan_dev_info *vlan = VLAN_DEV_INFO(dev);
> +	int err;
> +
> +	if (!tb[IFLA_LINK])
> +		return -EINVAL;
> +	if (!data[IFLA_VLAN_ID])
> +		return -EINVAL;
> +
> +	vlan->vlan_id  = nla_get_u16(data[IFLA_VLAN_ID]);
> +	vlan->real_dev = __dev_get_by_index(nla_get_u32(tb[IFLA_LINK]));

It seems you are scribbling on dev->priv before you validate that
it is OK to do so?

Or, maybe I'm just confused.

What is 'dev' here?

> +
> +	if (!vlan->real_dev)
> +		return -ENODEV;
> +	err = vlan_check_real_dev(vlan->real_dev, vlan->vlan_id);
> +	if (err < 0)
> +		return err;
> +
> +	err = vlan_changelink(dev, tb, data);
> +	if (err < 0)
> +		return err;
> +
> +	return register_vlan_dev(dev);
> +}

Other than this, this patch and the others in this series
look fine (except for the 4095 VID issue that we communicated
about earlier).

Thanks,
Ben

-- 
Ben Greear <[email-masked]>
Candela Technologies Inc  http://www.candelatech.com