From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nikolay Aleksandrov Subject: [PATCH net-next] switchdev: enforce no pvid flag in vlan ranges Date: Mon, 12 Oct 2015 14:01:39 +0200 Message-ID: <1444651299-2813-1-git-send-email-razor@blackwall.org> References: Cc: sfeldma@gmail.com, jiri@resnulli.us, vivien.didelot@savoirfairelinux.com, davem@davemloft.net, Nikolay Aleksandrov To: netdev@vger.kernel.org Return-path: Received: from mail-wi0-f180.google.com ([209.85.212.180]:37671 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751401AbbJLMBt (ORCPT ); Mon, 12 Oct 2015 08:01:49 -0400 Received: by wijq8 with SMTP id q8so54398532wij.0 for ; Mon, 12 Oct 2015 05:01:48 -0700 (PDT) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: From: Nikolay Aleksandrov We shouldn't allow BRIDGE_VLAN_INFO_PVID flag in VLAN ranges. Signed-off-by: Nikolay Aleksandrov --- net/switchdev/switchdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c index 6e4a4f9ad927..256c596de896 100644 --- a/net/switchdev/switchdev.c +++ b/net/switchdev/switchdev.c @@ -720,6 +720,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; -- 2.4.3