[PATCH mptcp-next] Squash-to: "selftests: mptcp: mptfo Initiator/Listener"

Paolo Abeni posted 1 patch 3 weeks, 2 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/508587c12b02e0f33388aa2fe30add27eb8c13c8.1668161791.git.pabeni@redhat.com
Maintainers: Mat Martineau <mathew.j.martineau@linux.intel.com>, Matthieu Baerts <matthieu.baerts@tessares.net>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Shuah Khan <shuah@kernel.org>
tools/testing/selftests/net/mptcp/mptcp_connect.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
[PATCH mptcp-next] Squash-to: "selftests: mptcp: mptfo Initiator/Listener"
Posted by Paolo Abeni 3 weeks, 2 days ago
We need to cope with multiple iteration of the remote peer address
selection loop

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 tools/testing/selftests/net/mptcp/mptcp_connect.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/testing/selftests/net/mptcp/mptcp_connect.c
index 134e569cd75a..8635619ab1fd 100644
--- a/tools/testing/selftests/net/mptcp/mptcp_connect.c
+++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c
@@ -375,13 +375,12 @@ static int sock_connect_mptcp(const char * const remoteaddr,
 			set_mark(sock, cfg_mark);
 
 		if (cfg_sockopt_types.mptfo) {
-			winfo->len = read(infd, winfo->buf, sizeof(winfo->buf));
+			if (!winfo->len)
+				winfo->len = read(infd, winfo->buf, sizeof(winfo->buf));
 
 			syn_copied = sendto(sock, winfo->buf, winfo->len, MSG_FASTOPEN,
 					    a->ai_addr, a->ai_addrlen);
-			if (syn_copied < 0)
-				perror("sendto");
-			if (syn_copied) {
+			if (syn_copied >= 0) {
 				winfo->off = syn_copied;
 				winfo->len -= syn_copied;
 				*peer = a;
-- 
2.38.1