From: Ernestas Kulik <ernestas.k@iconn-networks.com>
To: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
Ernestas Kulik <ernestas.k@iconn-networks.com>
Subject: [PATCH] llc: Return -EINPROGRESS from llc_ui_connect()
Date: Wed, 15 Apr 2026 09:34:57 +0300 [thread overview]
Message-ID: <20260415063457.1008868-1-ernestas.k@iconn-networks.com> (raw)
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
next reply other threads:[~2026-04-15 6:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-15 6:34 Ernestas Kulik [this message]
2026-04-20 18:41 ` [PATCH] llc: Return -EINPROGRESS from llc_ui_connect() 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260415063457.1008868-1-ernestas.k@iconn-networks.com \
--to=ernestas.k@iconn-networks.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox