Commit aa085ea1 authored by Florian Westphal's avatar Florian Westphal Committed by Pablo Neira Ayuso
Browse files

selftests: netfilter: conntrack_resize.sh: also use udpclash tool



Previous patch added a new clash resolution test case.
Also use this during conntrack resize stress test in addition
to icmp ping flood.

Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 78a58836
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -177,6 +177,22 @@ EOF
	done
}

ct_udpclash()
{
	local ns="$1"
	local duration="$2"
	local now=$(date +%s)
	local end=$((now + duration))

	[ -x udpclash ] || return

        while [ $now -lt $end ]; do
		ip netns exec "$ns" ./udpclash 127.0.0.1 $((RANDOM%65536)) > /dev/null 2>&1

		now=$(date +%s)
	done
}

# dump to /dev/null.  We don't want dumps to cause infinite loops
# or use-after-free even when conntrack table is altered while dumps
# are in progress.
@@ -267,6 +283,7 @@ insert_flood()

	ct_pingflood "$n" "$timeout" "floodresize" &
	ct_udpflood "$n" "$timeout" &
	ct_udpclash "$n" "$timeout" &

	insert_ctnetlink "$n" "$r" &
	ctflush "$n" "$timeout" &