This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 5c616721856eeaaf650417420ee8f67c2780db97 Author: zhanghongyu <[email protected]> AuthorDate: Fri Jul 18 19:03:50 2025 +0800 net/tcp/tcp_connect.c: move txnotify after setup_callback otherwise, when tx is modified to direct mode, wait will not be awakened Signed-off-by: zhanghongyu <[email protected]> --- net/tcp/tcp_connect.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/net/tcp/tcp_connect.c b/net/tcp/tcp_connect.c index 7f71b467f80..45a5594a349 100644 --- a/net/tcp/tcp_connect.c +++ b/net/tcp/tcp_connect.c @@ -349,10 +349,6 @@ int psock_tcp_connect(FAR struct socket *psock, } #endif /* CONFIG_NET_IPv4 */ - /* Notify the device driver that new connection is available. */ - - netdev_txnotify_dev(conn->dev); - /* Non-blocking connection ? set the socket error * and start the monitor */ @@ -377,6 +373,10 @@ int psock_tcp_connect(FAR struct socket *psock, info.tc_sem = &state.tc_sem; tls_cleanup_push(tls_get_info(), tcp_callback_cleanup, &info); + /* Notify the device driver that new connection is available. */ + + netdev_txnotify_dev(conn->dev); + /* Wait for either the connect to complete or for an * error/timeout to occur. * NOTES: net_sem_wait will also terminate if a @@ -430,6 +430,10 @@ int psock_tcp_connect(FAR struct socket *psock, tcp_stop_monitor(conn, TCP_ABORT); ret = ret2; } + + /* Notify the device driver that new connection is available. */ + + netdev_txnotify_dev(conn->dev); } }
