diff options
author | Vlad Yasevich <vyasevic@redhat.com> | 2014-09-12 22:26:17 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-13 23:21:56 +0200 |
commit | 635126b7ca13a01d6322fbf7bdc5d1c738d26807 (patch) | |
tree | b143668258d60aa96d7c232d77dbfd979c8a758c /net/bridge | |
parent | bridge: Check if vlan filtering is enabled only once. (diff) | |
download | linux-635126b7ca13a01d6322fbf7bdc5d1c738d26807.tar.xz linux-635126b7ca13a01d6322fbf7bdc5d1c738d26807.zip |
bridge: Allow clearing of pvid and untagged bitmap
Currently, it is possible to modify the vlan filter
configuration to add pvid or untagged support.
For example:
bridge vlan add vid 10 dev eth0
bridge vlan add vid 10 dev eth0 untagged pvid
The second statement will modify vlan 10 to
include untagged and pvid configuration.
However, it is currently impossible to go backwards
bridge vlan add vid 10 dev eth0 untagged pvid
bridge vlan add vid 10 dev eth0
Here nothing happens. This patch correct this so
that any modifiers not supplied are removed from
the configuration.
Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_vlan.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c index f645197b33d1..4b86738eca9a 100644 --- a/net/bridge/br_vlan.c +++ b/net/bridge/br_vlan.c @@ -27,9 +27,13 @@ static void __vlan_add_flags(struct net_port_vlans *v, u16 vid, u16 flags) { if (flags & BRIDGE_VLAN_INFO_PVID) __vlan_add_pvid(v, vid); + else + __vlan_delete_pvid(v, vid); if (flags & BRIDGE_VLAN_INFO_UNTAGGED) set_bit(vid, v->untagged_bitmap); + else + clear_bit(vid, v->untagged_bitmap); } static int __vlan_add(struct net_port_vlans *v, u16 vid, u16 flags) |