Skip to content

Commit 237f84a

Browse files
pmachatakuba-moo
authored andcommitted
selftests: forwarding: adf_mcd_start(): Allow configuring custom interfaces
Tests may wish to add other interfaces to listen on. Notably locally generated traffic uses dummy interfaces. The multicast daemon needs to know about these so that it allows forming rules that involve these interfaces, and so that net.ipv4.conf.X.mc_forwarding is set for the interfaces. To that end, allow passing in a list of interfaces to configure in addition to all the physical ones. Signed-off-by: Petr Machata <[email protected]> Reviewed-by: Nikolay Aleksandrov <[email protected]> Link: https://patch.msgid.link/2e8d83297985933be4850f2b9f296b3c27110388.1750113335.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 4baa1d3 commit 237f84a

File tree

1 file changed

+13
-0
lines changed
  • tools/testing/selftests/net/forwarding

1 file changed

+13
-0
lines changed

tools/testing/selftests/net/forwarding/lib.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1760,9 +1760,12 @@ mc_send()
17601760

17611761
adf_mcd_start()
17621762
{
1763+
local ifs=("$@")
1764+
17631765
local table_name="$MCD_TABLE_NAME"
17641766
local smcroutedir
17651767
local pid
1768+
local if
17661769
local i
17671770

17681771
check_command "$MCD" || return 1
@@ -1776,6 +1779,16 @@ adf_mcd_start()
17761779
"$smcroutedir/$table_name.conf"
17771780
done
17781781

1782+
for if in "${ifs[@]}"; do
1783+
if ! ip_link_has_flag "$if" MULTICAST; then
1784+
ip link set dev "$if" multicast on
1785+
defer ip link set dev "$if" multicast off
1786+
fi
1787+
1788+
echo "phyint $if enable" >> \
1789+
"$smcroutedir/$table_name.conf"
1790+
done
1791+
17791792
"$MCD" -N -I "$table_name" -f "$smcroutedir/$table_name.conf" \
17801793
-P "$smcroutedir/$table_name.pid"
17811794
busywait "$BUSYWAIT_TIMEOUT" test -e "$smcroutedir/$table_name.pid"

0 commit comments

Comments
 (0)