]> git.baikalelectronics.ru Git - kernel.git/commit
bridge: mdb: add/del entry on all vlans if vlan_filter is enabled and vid is 0
authorSatish Ashok <sashok@cumulusnetworks.com>
Mon, 3 Aug 2015 11:29:16 +0000 (13:29 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Aug 2015 22:43:35 +0000 (15:43 -0700)
commit9e7383fdd0e3348c69b0a50d577a7ebac45d2342
treea95e73acd81b76f1104edc37d0c3a82b08fceab5
parentc98fb2e1cc24c4ba91d219fc61999a88017b6f2c
bridge: mdb: add/del entry on all vlans if vlan_filter is enabled and vid is 0

Before this patch when a vid was not specified, the entry was added with
vid 0 which is useless when vlan_filtering is enabled. This patch makes
the entry to be added on all configured vlans when vlan filtering is
enabled and respectively deleted from all, if the entry vid is 0.
This is also closer to the way fdb works with regard to vid 0 and vlan
filtering.

Example:
Setup:
$ bridge vlan add vid 256 dev eth4
$ bridge vlan add vid 1024 dev eth4
$ bridge vlan add vid 64 dev eth3
$ bridge vlan add vid 128 dev eth3
$ bridge vlan
port vlan ids
eth3  1 PVID Egress Untagged
 64
 128

eth4  1 PVID Egress Untagged
 256
 1024
$ echo 1 > /sys/class/net/br0/bridge/vlan_filtering

Before:
$ bridge mdb add dev br0 port eth3 grp 239.0.0.1
$ bridge mdb
dev br0 port eth3 grp 239.0.0.1 temp

After:
$ bridge mdb add dev br0 port eth3 grp 239.0.0.1
$ bridge mdb
dev br0 port eth3 grp 239.0.0.1 temp vid 1
dev br0 port eth3 grp 239.0.0.1 temp vid 128
dev br0 port eth3 grp 239.0.0.1 temp vid 64

Signed-off-by: Satish Ashok <sashok@cumulusnetworks.com>
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_mdb.c