summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorNikolay Aleksandrov <nikolay@nvidia.com>2020-10-27 21:59:20 +0300
committerJakub Kicinski <kuba@kernel.org>2020-10-30 20:50:28 +0300
commit79ae3e256aa1cfaa801e23a13b7f9e1a49cacb20 (patch)
tree63d5de72942ebee7105d7acc0d1ba148587ba562 /tools
parent7afc9d8f82906754e16fce560fb4e9733bb9b75e (diff)
downloadlinux-79ae3e256aa1cfaa801e23a13b7f9e1a49cacb20.tar.xz
selftests: net: bridge: igmp: add support for packet source address
Add support for one more argument which specifies the source address to use. It will be later used for IGMPv3 S,G entry testing. Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/selftests/net/forwarding/bridge_igmp.sh13
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/testing/selftests/net/forwarding/bridge_igmp.sh b/tools/testing/selftests/net/forwarding/bridge_igmp.sh
index 481198300b72..1c19459dbc58 100755
--- a/tools/testing/selftests/net/forwarding/bridge_igmp.sh
+++ b/tools/testing/selftests/net/forwarding/bridge_igmp.sh
@@ -83,9 +83,10 @@ cleanup()
mcast_packet_test()
{
local mac=$1
- local ip=$2
- local host1_if=$3
- local host2_if=$4
+ local src_ip=$2
+ local ip=$3
+ local host1_if=$4
+ local host2_if=$5
local seen=0
# Add an ACL on `host2_if` which will tell us whether the packet
@@ -94,7 +95,7 @@ mcast_packet_test()
tc filter add dev $host2_if ingress protocol ip pref 1 handle 101 \
flower dst_mac $mac action drop
- $MZ $host1_if -c 1 -p 64 -b $mac -B $ip -t udp "dp=4096,sp=2048" -q
+ $MZ $host1_if -c 1 -p 64 -b $mac -A $src_ip -B $ip -t udp "dp=4096,sp=2048" -q
sleep 1
tc -j -s filter show dev $host2_if ingress \
@@ -120,7 +121,7 @@ v2reportleave_test()
bridge mdb show dev br0 | grep $TEST_GROUP 1>/dev/null
check_err $? "IGMPv2 report didn't create mdb entry for $TEST_GROUP"
- mcast_packet_test $TEST_GROUP_MAC $TEST_GROUP $h1 $h2
+ mcast_packet_test $TEST_GROUP_MAC 192.0.2.1 $TEST_GROUP $h1 $h2
check_fail $? "Traffic to $TEST_GROUP wasn't forwarded"
log_test "IGMPv2 report $TEST_GROUP"
@@ -136,7 +137,7 @@ v2reportleave_test()
bridge mdb show dev br0 | grep $TEST_GROUP 1>/dev/null
check_fail $? "Leave didn't delete mdb entry for $TEST_GROUP"
- mcast_packet_test $TEST_GROUP_MAC $TEST_GROUP $h1 $h2
+ mcast_packet_test $TEST_GROUP_MAC 192.0.2.1 $TEST_GROUP $h1 $h2
check_err $? "Traffic to $TEST_GROUP was forwarded without mdb entry"
log_test "IGMPv2 leave $TEST_GROUP"