diff options
author | Nikolay Aleksandrov <nikolay@cumulusnetworks.com> | 2015-10-12 15:01:39 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-13 14:41:40 +0300 |
commit | cc02aa8e41c50f690d0bb22ed5629468483421b7 (patch) | |
tree | 3c80c667e92619ba46b4f7d3a45709718ae4880b /net/switchdev | |
parent | f83665d0c41f3e24602f7dd03003574f852b326f (diff) | |
download | linux-cc02aa8e41c50f690d0bb22ed5629468483421b7.tar.xz |
switchdev: enforce no pvid flag in vlan ranges
We shouldn't allow BRIDGE_VLAN_INFO_PVID flag in VLAN ranges.
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Acked-by: Elad Raz <eladr@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/switchdev')
-rw-r--r-- | net/switchdev/switchdev.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c index 7a9ab90363be..b8aaf820ef65 100644 --- a/net/switchdev/switchdev.c +++ b/net/switchdev/switchdev.c @@ -727,6 +727,9 @@ static int switchdev_port_br_afspec(struct net_device *dev, if (vlan.vid_begin) return -EINVAL; vlan.vid_begin = vinfo->vid; + /* don't allow range of pvids */ + if (vlan.flags & BRIDGE_VLAN_INFO_PVID) + return -EINVAL; } else if (vinfo->flags & BRIDGE_VLAN_INFO_RANGE_END) { if (!vlan.vid_begin) return -EINVAL; |