mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
bridge: vlan: fix usage of vlan 0 and 4095 again
Vlan ids 0 and 4095 were disallowed by commit:8adff41c3d("bridge: Don't use VID 0 and 4095 in vlan filtering") but then the check was removed when vlan ranges were introduced by:bdced7ef78("bridge: support for multiple vlans and vlan ranges in setlink and dellink requests") So reintroduce the vlan range check. Before patch: [root@testvm ~]# bridge vlan add vid 0 dev eth0 master (succeeds) After Patch: [root@testvm ~]# bridge vlan add vid 0 dev eth0 master RTNETLINK answers: Invalid argument Signed-off-by: Nikolay Aleksandrov <[email protected]> Fixes:bdced7ef78("bridge: support for multiple vlans and vlan ranges in setlink and dellink requests") Acked-by: Toshiaki Makita <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
c4555d16d9
commit
462e1ead92
1 changed files with 2 additions and 0 deletions
|
|
@ -457,6 +457,8 @@ static int br_afspec(struct net_bridge *br,
|
|||
if (nla_len(attr) != sizeof(struct bridge_vlan_info))
|
||||
return -EINVAL;
|
||||
vinfo = nla_data(attr);
|
||||
if (!vinfo->vid || vinfo->vid >= VLAN_VID_MASK)
|
||||
return -EINVAL;
|
||||
if (vinfo->flags & BRIDGE_VLAN_INFO_RANGE_BEGIN) {
|
||||
if (vinfo_start)
|
||||
return -EINVAL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue