2 # SPDX-License-Identifier: GPL-2.0
4 # Test bond device handling of addr lists (dev->uc, mc)
10 bond_listen_lacpdu_multicast_case_down
11 bond_listen_lacpdu_multicast_case_up
16 lib_dir=$(dirname "$0")
17 source "$lib_dir"/../../../net/forwarding/lib.sh
19 source "$lib_dir"/lag_lib.sh
24 local ifnames=(dummy1 dummy2 bond1 mv0)
27 for ifname in "${ifnames[@]}"; do
28 ip link del "$ifname" &>/dev/null
40 # bond driver control paths vary between modes that have a primary slave
41 # (bond_uses_primary()) and others. Test both kinds of modes.
47 test_LAG_cleanup "bonding" "active-backup"
50 bond_cleanup_mode4() {
53 test_LAG_cleanup "bonding" "802.3ad"
56 bond_listen_lacpdu_multicast()
58 # Initial state of bond device, up | down
60 local lacpdu_mc="01:80:c2:00:00:02"
62 ip link add dummy1 type dummy
63 ip link add bond1 "$init_state" type bond mode 802.3ad
64 ip link set dev dummy1 master bond1
65 if [ "$init_state" = "down" ]; then
66 ip link set dev bond1 up
69 grep_bridge_fdb "$lacpdu_mc" bridge fdb show brport dummy1 >/dev/null
70 check_err $? "LACPDU multicast address not present on slave (1)"
72 ip link set dev bond1 down
74 not grep_bridge_fdb "$lacpdu_mc" bridge fdb show brport dummy1 >/dev/null
75 check_err $? "LACPDU multicast address still present on slave"
77 ip link set dev bond1 up
79 grep_bridge_fdb "$lacpdu_mc" bridge fdb show brport dummy1 >/dev/null
80 check_err $? "LACPDU multicast address not present on slave (2)"
84 log_test "bonding LACPDU multicast address to slave (from bond $init_state)"
87 # The LACPDU mc addr is added by different paths depending on the initial state
88 # of the bond when enslaving a device. Test both cases.
90 bond_listen_lacpdu_multicast_case_down()
94 bond_listen_lacpdu_multicast "down"
97 bond_listen_lacpdu_multicast_case_up()
101 bond_listen_lacpdu_multicast "up"