Hi Tobias,

2017-05-15, 13:08:19 +0200, Tobias Jungel wrote:
> Currently it is allowed to set the default pvid of a bridge to a value
> above VLAN_VID_MASK (0xfff). This patch checks the passed pvid and
> disables the pvid in case it is out of bounds.

Could we return an error (-EINVAL) to userspace instead?  Silently
disabling the feature seems confusing to me.  This would probably be
better in br_validate() (like the IFLA_BR_VLAN_PROTOCOL check), since
there's already such a check when setting default_pvid from sysfs (in
br_vlan_set_default_pvid()).

> 
> Reproduce by calling:
> 
> [root@test ~]# ip l a type bridge
> [root@test ~]# ip l a type dummy
> [root@test ~]# ip l s bridge0 type bridge vlan_filtering 1
> [root@test ~]# ip l s bridge0 type bridge vlan_default_pvid 9999
> [root@test ~]# ip l s dummy0 master bridge0
> [root@test ~]# bridge vlan
> port  vlan ids
> bridge0        9999 PVID Egress Untagged
> 
> dummy0         9999 PVID Egress Untagged

You'll also need to add a Signed-off-by, and a Fixes tag would be nice.


Thanks,

-- 
Sabrina

Reply via email to