]> git.proxmox.com Git - pve-kernel-jessie.git/blame - bridge-vlandrange4.patch
add sources for 4.1 based kernel (ubuntu wily)
[pve-kernel-jessie.git] / bridge-vlandrange4.patch
CommitLineData
82000aac
AD
1From patchwork Thu Jul 2 12:48:17 2015
2Content-Type: text/plain; charset="utf-8"
3MIME-Version: 1.0
4Content-Transfer-Encoding: 7bit
5Subject: [net] bridge: vlan: fix usage of vlan 0 and 4095 again
6From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
7X-Patchwork-Id: 490608
8Message-Id: <1435841297-44200-1-git-send-email-nikolay@cumulusnetworks.com>
9To: netdev@vger.kernel.org
10Cc: vyasevich@gmail.com, bridge@lists.linux-foundation.org,
11 davem@davemloft.net, toshiaki.makita1@gmail.com,
12 stephen@networkplumber.org, roopa@cumulusnetworks.com,
13 Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
14Date: Thu, 2 Jul 2015 05:48:17 -0700
15
16Vlan ids 0 and 4095 were disallowed by commit:
178adff41c3d25 ("bridge: Don't use VID 0 and 4095 in vlan filtering")
18but then the check was removed when vlan ranges were introduced by:
19bdced7ef7838 ("bridge: support for multiple vlans and vlan ranges in setlink and dellink requests")
20So reintroduce the vlan range check.
21Before patch:
22[root@testvm ~]# bridge vlan add vid 0 dev eth0 master
23(succeeds)
24After Patch:
25[root@testvm ~]# bridge vlan add vid 0 dev eth0 master
26RTNETLINK answers: Invalid argument
27
28Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
29Fixes: bdced7ef7838 ("bridge: support for multiple vlans and vlan ranges in setlink and dellink requests")
30Acked-by: Toshiaki Makita <toshiaki.makita1@gmail.com>
31---
32 net/bridge/br_netlink.c | 2 ++
33 1 file changed, 2 insertions(+)
34
35diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
36index 6b67ed3831de..364bdc98bd9b 100644
37--- a/net/bridge/br_netlink.c
38+++ b/net/bridge/br_netlink.c
39@@ -457,6 +457,8 @@ static int br_afspec(struct net_bridge *br,
40 if (nla_len(attr) != sizeof(struct bridge_vlan_info))
41 return -EINVAL;
42 vinfo = nla_data(attr);
43+ if (!vinfo->vid || vinfo->vid >= VLAN_VID_MASK)
44+ return -EINVAL;
45 if (vinfo->flags & BRIDGE_VLAN_INFO_RANGE_BEGIN) {
46 if (vinfo_start)
47 return -EINVAL;