summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nuttx/net/tcp/tcp_conn.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/nuttx/net/tcp/tcp_conn.c b/nuttx/net/tcp/tcp_conn.c
index d92923d0b..5209646b1 100644
--- a/nuttx/net/tcp/tcp_conn.c
+++ b/nuttx/net/tcp/tcp_conn.c
@@ -651,10 +651,13 @@ int tcp_bind(FAR struct tcp_conn_s *conn,
int port;
#ifdef CONFIG_NETDEV_MULTINIC
net_ipaddr_t ipaddr;
+#endif
/* Verify or select a local port and address */
flags = net_lock();
+
+#ifdef CONFIG_NETDEV_MULTINIC
#ifdef CONFIG_NET_IPv6
/* Get the IPv6 address that we are binding to */
@@ -673,6 +676,7 @@ int tcp_bind(FAR struct tcp_conn_s *conn,
port = tcp_selectport(ntohs(addr->sin_port));
#endif
+
net_unlock(flags);
if (port < 0)