Skip to content

Commit 38e00d1

Browse files
rluboskartben
authored andcommitted
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>
1 parent b029d79 commit 38e00d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/net/ip/tcp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3026,7 +3026,7 @@ static enum net_verdict tcp_in(struct tcp *conn, struct net_pkt *pkt)
30263026
accept_cb(conn->context, &conn->context->remote,
30273027
net_context_get_family(context) == AF_INET6 ?
30283028
sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in),
3029-
0, context);
3029+
0, context->user_data);
30303030

30313031
next = TCP_ESTABLISHED;
30323032

0 commit comments

Comments
 (0)