You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ma...@apache.org on 2022/05/17 22:54:22 UTC
[incubator-nuttx] branch master updated: net: fix the build when CONFIG_NET_TCP_WRITE_BUFFERS is not enabled
This is an automated email from the ASF dual-hosted git repository.
masayuki pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 6ea8bac1c5 net: fix the build when CONFIG_NET_TCP_WRITE_BUFFERS is not enabled
6ea8bac1c5 is described below
commit 6ea8bac1c532ef7de78dc55b9d25a17f6c6dbe61
Author: Sebastien Lorquet <se...@lorquet.fr>
AuthorDate: Tue May 17 18:42:39 2022 +0200
net: fix the build when CONFIG_NET_TCP_WRITE_BUFFERS is not enabled
---
net/tcp/Make.defs | 5 ++++-
net/tcp/tcp_dump.c | 14 ++++++++++++++
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/net/tcp/Make.defs b/net/tcp/Make.defs
index e022836d4e..e5e71cb208 100644
--- a/net/tcp/Make.defs
+++ b/net/tcp/Make.defs
@@ -59,10 +59,13 @@ NET_CSRCS += tcp_recvwindow.c tcp_netpoll.c tcp_ioctl.c
ifeq ($(CONFIG_NET_TCP_WRITE_BUFFERS),y)
NET_CSRCS += tcp_wrbuffer.c
+endif
+
+# TCP debug
+
ifeq ($(CONFIG_DEBUG_FEATURES),y)
NET_CSRCS += tcp_dump.c
endif
-endif
# Include TCP build support
diff --git a/net/tcp/tcp_dump.c b/net/tcp/tcp_dump.c
index 4e5f0823bf..a2ed37dd20 100644
--- a/net/tcp/tcp_dump.c
+++ b/net/tcp/tcp_dump.c
@@ -52,6 +52,7 @@ void tcp_event_handler_dump(FAR struct net_driver_s *dev,
uint16_t flags,
FAR struct tcp_conn_s *conn)
{
+#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
nerr("ERROR: conn->dev == NULL or pvconn != conn:"
" dev=%p pvconn=%p pvpriv=%p flags=0x%04x"
" conn->dev=%p conn->flags=0x%04x tcpstateflags=0x%02x crefs=%d"
@@ -63,6 +64,19 @@ void tcp_event_handler_dump(FAR struct net_driver_s *dev,
conn->isn, tcp_getsequence(conn->sndseq),
(uint32_t)conn->tx_unacked, conn->sent,
conn, conn->sconn.s_flags);
+#else
+ nerr("ERROR: conn->dev == NULL or pvconn != conn:"
+ " dev=%p pvconn=%p pvpriv=%p flags=0x%04x"
+ " conn->dev=%p conn->flags=0x%04x tcpstateflags=0x%02x crefs=%d"
+ " sndseq=%" PRIu32
+ " tx_unacked=%" PRId32
+ " conn=%p s_flags=0x%02x\n",
+ dev, pvconn, pvpriv, flags,
+ conn->dev, conn->flags, conn->tcpstateflags, conn->crefs,
+ tcp_getsequence(conn->sndseq),
+ (uint32_t)conn->tx_unacked,
+ conn, conn->sconn.s_flags);
+#endif
}
/****************************************************************************