Commit 8c1fe0a5 authored by Matthieu Baerts (NGI0)'s avatar Matthieu Baerts (NGI0) Committed by Jakub Kicinski
Browse files

selftests: mptcp: connect: avoid double packet traces



When the same netns is used for the listener and the connector, no need
to take exactly the same packet trace twice, one is enough.

This avoids confusions when the traces are the same, and wasting
resources which might not help reproducing an issue.

While at it, avoid long lines and double spaces now that these lines are
no longer aligned.

Reviewed-by: default avatarGeliang Tang <geliang@kernel.org>
Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20251114-net-next-mptcp-sft-count-cache-stats-timeout-v1-6-863cb04e1b7b@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 71388a9f
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -375,11 +375,15 @@ do_transfer()
		local capfile="${rndh}-${connector_ns:0:3}-${listener_ns:0:3}-${cl_proto}-${srv_proto}-${connect_addr}-${port}"
		local capopt="-i any -s 65535 -B 32768 ${capuser}"

		ip netns exec ${listener_ns}  tcpdump ${capopt} -w "${capfile}-listener.pcap"  >> "${capout}" 2>&1 &
		ip netns exec ${listener_ns} tcpdump ${capopt} \
			-w "${capfile}-listener.pcap" >> "${capout}" 2>&1 &
		local cappid_listener=$!

		ip netns exec ${connector_ns} tcpdump ${capopt} -w "${capfile}-connector.pcap" >> "${capout}" 2>&1 &
		if [ ${listener_ns} != ${connector_ns} ]; then
			ip netns exec ${connector_ns} tcpdump ${capopt} \
				-w "${capfile}-connector.pcap" >> "${capout}" 2>&1 &
			local cappid_connector=$!
		fi

		sleep 1
	fi
@@ -416,8 +420,10 @@ do_transfer()
	if $capture; then
		sleep 1
		kill ${cappid_listener}
		if [ ${listener_ns} != ${connector_ns} ]; then
			kill ${cappid_connector}
		fi
	fi

	mptcp_lib_nstat_get "${listener_ns}"
	if [ ${listener_ns} != ${connector_ns} ]; then