net: tcp: Fix user_data provided to accept callback

TCP implementation provided the parent net_context pointer to the
accept callback instead of the user_data pointer registered with
net_tcp_accept(). This worked fine with the socket integration, as
sockets explicitly registered parent context as user_data, however it
shouldn't be hardcoded like this at the TCP level.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
Robert Lubos 2025-05-27 10:38:59 +02:00 committed by Benjamin Cabé
commit 38e00d1969

View file

@ -3026,7 +3026,7 @@ static enum net_verdict tcp_in(struct tcp *conn, struct net_pkt *pkt)
accept_cb(conn->context, &conn->context->remote,
net_context_get_family(context) == AF_INET6 ?
sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in),
0, context);
0, context->user_data);
next = TCP_ESTABLISHED;