Skip to content

Commit 864ba40

Browse files
ernestaskkuba-moo
authored andcommitted
llc: Return -EINPROGRESS from llc_ui_connect()
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 if connect() would not block, akin to AF_INET sockets. Signed-off-by: Ernestas Kulik <ernestas.k@iconn-networks.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260421060304.285419-1-ernestas.k@iconn-networks.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 67bf002 commit 864ba40

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

net/llc/af_llc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,10 @@ static int llc_ui_connect(struct socket *sock, struct sockaddr_unsized *uaddr,
520520
if (sk->sk_state == TCP_SYN_SENT) {
521521
const long timeo = sock_sndtimeo(sk, flags & O_NONBLOCK);
522522

523-
if (!timeo || !llc_ui_wait_for_conn(sk, timeo))
523+
if (!timeo || !llc_ui_wait_for_conn(sk, timeo)) {
524+
rc = -EINPROGRESS;
524525
goto out;
526+
}
525527

526528
rc = sock_intr_errno(timeo);
527529
if (signal_pending(current))

0 commit comments

Comments
 (0)