MPTCP Linux Development
 help / color / mirror / Atom feed
* [PATCH mptcp-net] mptcp: Do not return EINPROGRESS when subflow creation succeeds
@ 2022-07-15 18:12 Mat Martineau
  2022-07-15 19:58 ` mptcp: Do not return EINPROGRESS when subflow creation succeeds: Tests Results MPTCP CI
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Mat Martineau @ 2022-07-15 18:12 UTC (permalink / raw)
  To: mptcp; +Cc: Mat Martineau

New subflows are created within the kernel using O_NONBLOCK, so
EINPROGRESS is the expected return value from kernel_connect().
__mptcp_subflow_connect() has the correct logic to consider EINPROGRESS
to be a successful case, but it has also used that error code as its
return value.

Before v5.19 this was benign: all the callers ignored the return
value. Starting in v5.19 there is a MPTCP_PM_CMD_SUBFLOW_CREATE generic
netlink command that does use the return value, so the EINPROGRESS gets
propagated to userspace.

Make __mptcp_subflow_connect() always return 0 on success instead.

Fixes: ec3edaa7ca6c ("mptcp: Add handling of outgoing MP_JOIN requests")
Fixes: 702c2f646d42 ("mptcp: netlink: allow userspace-driven subflow establishment")
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
---
 net/mptcp/subflow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 63e8892ec807..af28f3b60389 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -1533,7 +1533,7 @@ int __mptcp_subflow_connect(struct sock *sk, const struct mptcp_addr_info *loc,
 	mptcp_sock_graft(ssk, sk->sk_socket);
 	iput(SOCK_INODE(sf));
 	WRITE_ONCE(msk->allow_infinite_fallback, false);
-	return err;
+	return 0;
 
 failed_unlink:
 	list_del(&subflow->node);
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-07-26 10:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-15 18:12 [PATCH mptcp-net] mptcp: Do not return EINPROGRESS when subflow creation succeeds Mat Martineau
2022-07-15 19:58 ` mptcp: Do not return EINPROGRESS when subflow creation succeeds: Tests Results MPTCP CI
2022-07-20 23:35 ` [PATCH mptcp-net] mptcp: Do not return EINPROGRESS when subflow creation succeeds Mat Martineau
2022-07-25 20:52 ` Mat Martineau
2022-07-26 10:20   ` Matthieu Baerts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox