2 # SPDX-License-Identifier: GPL-2.0
4 # Verify that adding host mdb entries work as intended for all types of
5 # multicast filters: ipv4, ipv6, and mac
7 ALL_TESTS
="mdb_add_del_test"
10 TEST_GROUP_IP4
="225.1.2.3"
11 TEST_GROUP_IP6
="ff02::42"
12 TEST_GROUP_MAC
="01:00:01:c0:ff:ee"
18 simple_if_init
$h1 192.0.2.1/24 2001:db8
:1::1/64
23 simple_if_fini
$h1 192.0.2.1/24 2001:db8
:1::1/64
28 # Enable multicast filtering
29 ip link add dev br0
type bridge mcast_snooping
1
31 ip link
set dev
$swp1 master br0
33 ip link
set dev br0 up
34 ip link
set dev
$swp1 up
39 ip link
set dev
$swp1 down
70 bridge mdb add dev br0 port br0 grp
$group $flag 2>/dev
/null
71 check_err $?
"Failed adding $group to br0, port br0"
73 if [ -z "$flag" ]; then
77 bridge mdb show dev br0 |
grep $group |
grep -q $flag 2>/dev
/null
78 check_err $?
"$group not added with $flag flag"
80 bridge mdb del dev br0 port br0 grp
$group 2>/dev
/null
81 check_err $?
"Failed deleting $group from br0, port br0"
83 bridge mdb show dev br0 |
grep -q $group >/dev
/null
84 check_err_fail
1 $?
"$group still in mdb after delete"
86 log_test
"MDB add/del group $group to bridge port br0"
91 do_mdb_add_del
$TEST_GROUP_MAC permanent
92 do_mdb_add_del
$TEST_GROUP_IP4
93 do_mdb_add_del
$TEST_GROUP_IP6