Commit cb034948 authored by Ido Schimmel's avatar Ido Schimmel Committed by Jakub Kicinski

selftests: forwarding: bridge_mdb_max: Fix failing test with old libnet

As explained in commit 8bcfb4ae ("selftests: forwarding: Fix failing
tests with old libnet"), old versions of libnet (used by mausezahn) do
not use the "SO_BINDTODEVICE" socket option. For IP unicast packets,
this can be solved by prefixing mausezahn invocations with "ip vrf
exec". However, IP multicast packets do not perform routing and simply
egress the bound device, which does not exist in this case.

Fix by specifying the source and destination MAC of the packet which
will cause mausezahn to use a packet socket instead of an IP socket.

Fixes: 3446dcd7 ("selftests: forwarding: bridge_mdb_max: Add a new selftest")
Reported-by: default avatarMirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
Closes: https://lore.kernel.org/netdev/adc5e40d-d040-a65e-eb26-edf47dac5b02@alu.unizg.hr/Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Tested-by: default avatarMirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
Reviewed-by: default avatarHangbin Liu <liuhangbin@gmail.com>
Acked-by: default avatarNikolay Aleksandrov <razor@blackwall.org>
Link: https://lore.kernel.org/r/20230808141503.4060661-17-idosch@nvidia.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent e98e195d
...@@ -252,7 +252,8 @@ ctl4_entries_add() ...@@ -252,7 +252,8 @@ ctl4_entries_add()
local IPs=$(seq -f 192.0.2.%g 1 $((n - 1))) local IPs=$(seq -f 192.0.2.%g 1 $((n - 1)))
local peer=$(locus_dev_peer $locus) local peer=$(locus_dev_peer $locus)
local GRP=239.1.1.${grp} local GRP=239.1.1.${grp}
$MZ $peer -c 1 -A 192.0.2.1 -B $GRP \ local dmac=01:00:5e:01:01:$(printf "%02x" $grp)
$MZ $peer -a own -b $dmac -c 1 -A 192.0.2.1 -B $GRP \
-t ip proto=2,p=$(igmpv3_is_in_get $GRP $IPs) -q -t ip proto=2,p=$(igmpv3_is_in_get $GRP $IPs) -q
sleep 1 sleep 1
...@@ -272,7 +273,8 @@ ctl4_entries_del() ...@@ -272,7 +273,8 @@ ctl4_entries_del()
local peer=$(locus_dev_peer $locus) local peer=$(locus_dev_peer $locus)
local GRP=239.1.1.${grp} local GRP=239.1.1.${grp}
$MZ $peer -c 1 -A 192.0.2.1 -B 224.0.0.2 \ local dmac=01:00:5e:00:00:02
$MZ $peer -a own -b $dmac -c 1 -A 192.0.2.1 -B 224.0.0.2 \
-t ip proto=2,p=$(igmpv2_leave_get $GRP) -q -t ip proto=2,p=$(igmpv2_leave_get $GRP) -q
sleep 1 sleep 1
! bridge mdb show dev br0 | grep -q $GRP ! bridge mdb show dev br0 | grep -q $GRP
...@@ -289,8 +291,10 @@ ctl6_entries_add() ...@@ -289,8 +291,10 @@ ctl6_entries_add()
local peer=$(locus_dev_peer $locus) local peer=$(locus_dev_peer $locus)
local SIP=fe80::1 local SIP=fe80::1
local GRP=ff0e::${grp} local GRP=ff0e::${grp}
local dmac=33:33:00:00:00:$(printf "%02x" $grp)
local p=$(mldv2_is_in_get $SIP $GRP $IPs) local p=$(mldv2_is_in_get $SIP $GRP $IPs)
$MZ -6 $peer -c 1 -A $SIP -B $GRP -t ip hop=1,next=0,p="$p" -q $MZ -6 $peer -a own -b $dmac -c 1 -A $SIP -B $GRP \
-t ip hop=1,next=0,p="$p" -q
sleep 1 sleep 1
local nn=$(bridge mdb show dev br0 | grep $GRP | wc -l) local nn=$(bridge mdb show dev br0 | grep $GRP | wc -l)
...@@ -310,8 +314,10 @@ ctl6_entries_del() ...@@ -310,8 +314,10 @@ ctl6_entries_del()
local peer=$(locus_dev_peer $locus) local peer=$(locus_dev_peer $locus)
local SIP=fe80::1 local SIP=fe80::1
local GRP=ff0e::${grp} local GRP=ff0e::${grp}
local dmac=33:33:00:00:00:$(printf "%02x" $grp)
local p=$(mldv1_done_get $SIP $GRP) local p=$(mldv1_done_get $SIP $GRP)
$MZ -6 $peer -c 1 -A $SIP -B $GRP -t ip hop=1,next=0,p="$p" -q $MZ -6 $peer -a own -b $dmac -c 1 -A $SIP -B $GRP \
-t ip hop=1,next=0,p="$p" -q
sleep 1 sleep 1
! bridge mdb show dev br0 | grep -q $GRP ! bridge mdb show dev br0 | grep -q $GRP
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment