0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 set -e
0025 tmp=$(mktemp -q dump.XXXXXX)
0026 cleanup() {
0027 ip link del fab-br0 >/dev/null 2>&1 || :
0028 ip link del fbond >/dev/null 2>&1 || :
0029 ip link del veth1-bond >/dev/null 2>&1 || :
0030 ip link del veth2-bond >/dev/null 2>&1 || :
0031 modprobe -r bonding >/dev/null 2>&1 || :
0032 rm -f -- ${tmp}
0033 }
0034
0035 trap cleanup 0 1 2
0036 cleanup
0037 sleep 1
0038
0039
0040 ip link add fab-br0 address 52:54:00:3B:7C:A6 mtu 1500 type bridge \
0041 forward_delay 15
0042
0043
0044 ip link add fbond type bond mode 4 miimon 200 xmit_hash_policy 1 \
0045 ad_actor_sys_prio 65535 lacp_rate fast
0046
0047
0048 ip link set fbond address 52:54:00:3B:7C:A6
0049 ip link set fbond up
0050
0051
0052 ip link set fbond type bond ad_actor_sys_prio 65535
0053
0054
0055 ip link add name veth1-bond type veth peer name veth1-end
0056 ip link add name veth2-bond type veth peer name veth2-end
0057
0058
0059 ip link set fbond master fab-br0
0060 ip link set veth1-bond down master fbond
0061 ip link set veth2-bond down master fbond
0062
0063
0064 ip link set veth1-end up
0065 ip link set veth2-end up
0066 ip link set fab-br0 up
0067 ip link set fbond up
0068 ip addr add dev fab-br0 10.0.0.3
0069
0070 tcpdump -n -i veth1-end -e ether proto 0x8809 >${tmp} 2>&1 &
0071 sleep 15
0072 pkill tcpdump >/dev/null 2>&1
0073 rc=0
0074 num=$(grep "packets captured" ${tmp} | awk '{print $1}')
0075 if test "$num" -gt 0; then
0076 echo "PASS, captured ${num}"
0077 else
0078 echo "FAIL"
0079 rc=1
0080 fi
0081 exit $rc