From: Ernestas Kulik <ernestas.k@iconn-networks.com>
To: netdev@vger.kernel.org
Cc: kuba@kernel.org, linux-kernel@vger.kernel.org,
Ernestas Kulik <ernestas.k@iconn-networks.com>
Subject: [PATCH v2] llc: Return -EINPROGRESS from llc_ui_connect()
Date: Tue, 21 Apr 2026 08:54:58 +0300 [thread overview]
Message-ID: <20260421055458.263071-1-ernestas.k@iconn-networks.com> (raw)
In-Reply-To: <20260415063457.1008868-1-ernestas.k@iconn-networks.com>
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.
More specifically, the issue was discovered in libcoap, where
newly-added AF_LLC socket support was behaving differently from AF_INET
connections due to EINPROGRESS handling being skipped.
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 | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
index 59d593bb5d18..1b210db3119e 100644
--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -518,12 +518,14 @@ static int llc_ui_connect(struct socket *sock, struct sockaddr_unsized *uaddr,
}
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))
+ if (!timeo || !llc_ui_wait_for_conn(sk, timeo)) {
+ rc = -EINPROGRESS;
goto out;
+ }
rc = sock_intr_errno(timeo);
if (signal_pending(current))
goto out;
}
--
2.53.0
next prev parent reply other threads:[~2026-04-21 5:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Ernestas Kulik [this message]
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=20260421055458.263071-1-ernestas.k@iconn-networks.com \
--to=ernestas.k@iconn-networks.com \
--cc=kuba@kernel.org \
--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