Skip to content

Commit

Permalink
bridge: vlan: enforce no pvid flag in vlan ranges
Browse files Browse the repository at this point in the history
Currently it's possible for someone to send a vlan range to the kernel
with the pvid flag set which will result in the pvid bouncing from a
vlan to vlan and isn't correct, it also introduces problems for hardware
where it doesn't make sense having more than 1 pvid. iproute2 already
enforces this, so let's enforce it on kernel-side as well.

Reported-by: Elad Raz <eladr@mellanox.com>
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Nikolay Aleksandrov authored and David S. Miller committed Oct 13, 2015
1 parent cbb41b9 commit 6623c60
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/bridge/br_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,9 @@ static int br_afspec(struct net_bridge *br,
if (vinfo_start)
return -EINVAL;
vinfo_start = vinfo;
/* don't allow range of pvids */
if (vinfo_start->flags & BRIDGE_VLAN_INFO_PVID)
return -EINVAL;
continue;
}

Expand Down

0 comments on commit 6623c60

Please sign in to comment.