Skip to content

Commit d70a854

Browse files
committed
net: tls: Set accepting socket to LISTENING state
This is related to commit 1a6f4a6 ("net: tcp: Accept connections only in LISTENING state") which made the system to only accept new connections if the application had called accept(). Unfortunately the TLS accept was not fixed by that commit so we were in wrong state when accepting TLS sockets. This commit fixes that issue. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent 345b64f commit d70a854

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

subsys/net/lib/sockets/sockets_tls.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,6 +1267,10 @@ int ztls_accept_ctx(struct net_context *parent, struct sockaddr *addr,
12671267
return -1;
12681268
}
12691269

1270+
if (net_context_get_ip_proto(parent) == IPPROTO_TCP) {
1271+
net_context_set_state(parent, NET_CONTEXT_LISTENING);
1272+
}
1273+
12701274
child = k_fifo_get(&parent->accept_q, K_FOREVER);
12711275

12721276
#ifdef CONFIG_USERSPACE

0 commit comments

Comments
 (0)