public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] llc: Return -EINPROGRESS from llc_ui_connect()
@ 2026-04-15  6:34 Ernestas Kulik
  2026-04-20 18:41 ` Jakub Kicinski
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ernestas Kulik @ 2026-04-15  6:34 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, Ernestas Kulik

Given a zero sk_sndtimeo, llc_ui_connect() skips waiting for state
change and returns 0, confusing userspace applications that will assume
the socket is connected, making e.g. getpeername() calls error out.

Set rc to -EINPROGRESS before considering blocking, akin to AF_INET
sockets.

Signed-off-by: Ernestas Kulik <ernestas.k@iconn-networks.com>
---
 net/llc/af_llc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
index 59d593bb5d18..9317d092ba84 100644
--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -515,10 +515,12 @@ static int llc_ui_connect(struct socket *sock, struct sockaddr_unsized *uaddr,
 		sock->state  = SS_UNCONNECTED;
 		sk->sk_state = TCP_CLOSE;
 		goto out;
 	}
 
+	rc = -EINPROGRESS;
+
 	if (sk->sk_state == TCP_SYN_SENT) {
 		const long timeo = sock_sndtimeo(sk, flags & O_NONBLOCK);
 
 		if (!timeo || !llc_ui_wait_for_conn(sk, timeo))
 			goto out;
-- 
2.53.0


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

end of thread, other threads:[~2026-04-21  6:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-15  6:34 [PATCH] llc: Return -EINPROGRESS from llc_ui_connect() Ernestas Kulik
2026-04-20 18:41 ` Jakub Kicinski
2026-04-21  5:48   ` Ernestas Kulik
2026-04-21  5:54 ` [PATCH v2] " Ernestas Kulik
2026-04-21  6:02 ` [PATCH v3] " Ernestas Kulik

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