diff options
Diffstat (limited to 'net/switchdev/switchdev.c')
-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 fda38f830a10..77f5d17e2612 100644 --- a/net/switchdev/switchdev.c +++ b/net/switchdev/switchdev.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/notifier.h> | 16 | #include <linux/notifier.h> |
17 | #include <linux/netdevice.h> | 17 | #include <linux/netdevice.h> |
18 | #include <linux/if_bridge.h> | 18 | #include <linux/if_bridge.h> |
19 | #include <linux/if_vlan.h> | ||
19 | #include <net/ip_fib.h> | 20 | #include <net/ip_fib.h> |
20 | #include <net/switchdev.h> | 21 | #include <net/switchdev.h> |
21 | 22 | ||
@@ -634,6 +635,8 @@ static int switchdev_port_br_afspec(struct net_device *dev, | |||
634 | if (nla_len(attr) != sizeof(struct bridge_vlan_info)) | 635 | if (nla_len(attr) != sizeof(struct bridge_vlan_info)) |
635 | return -EINVAL; | 636 | return -EINVAL; |
636 | vinfo = nla_data(attr); | 637 | vinfo = nla_data(attr); |
638 | if (!vinfo->vid || vinfo->vid >= VLAN_VID_MASK) | ||
639 | return -EINVAL; | ||
637 | vlan->flags = vinfo->flags; | 640 | vlan->flags = vinfo->flags; |
638 | if (vinfo->flags & BRIDGE_VLAN_INFO_RANGE_BEGIN) { | 641 | if (vinfo->flags & BRIDGE_VLAN_INFO_RANGE_BEGIN) { |
639 | if (vlan->vid_begin) | 642 | if (vlan->vid_begin) |