2 # SPDX-License-Identifier: GPL-2.0
17 [ "$KSFT_MACHINE_SLOW" = "yes" ] && maxpolicies
=10000
28 ip netns
exec "$ns" ip xfrm policy flush
30 for i
in $
(seq 1 100);do
33 for j
in $
(seq 1 255);do
37 for a
in $
(seq 1 8 255); do
38 policies
=$
((policies
+1))
39 [ "$policies" -gt "$max" ] && return
40 echo xfrm policy add src
10.
$s.
$j.0/30 dst
10.
$d.
$j.
$a/$pfx dir
$dir action block
42 for a
in $
(seq 1 8 255); do
43 policies
=$
((policies
+1))
44 [ "$policies" -gt "$max" ] && return
45 echo xfrm policy add src
10.
$s.
$j.
$a/30 dst
10.
$d.
$j.0/$pfx dir
$dir action block
58 do_dummies4
"out" "$max" > "$tmp"
59 if ! timeout
"$timeout" ip netns
exec "$ns" ip
-batch "$tmp";then
60 echo "WARNING: policy insertion cancelled after $timeout"
65 result
=$
((stop-start
))
67 policies
=$
(wc -l < "$tmp")
68 printf "Inserted %-06s policies in $result ms\n" $policies
70 have
=$
(ip netns
exec "$ns" ip xfrm policy show |
grep "action block" |
wc -l)
71 if [ "$have" -ne "$policies" ]; then
72 echo "WARNING: mismatch, have $have policies, expected $policies"
78 while [ $p -le "$maxpolicies" ]; do