You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/09/19 07:45:26 UTC

[incubator-nuttx] branch master updated: net/procfs: disable tcp/udp proc node if no stack available

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/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new f286012c0d net/procfs: disable tcp/udp proc node if no stack available
f286012c0d is described below

commit f286012c0d3e468507af87662fac839850289ff1
Author: chao an <an...@xiaomi.com>
AuthorDate: Mon Sep 19 12:36:15 2022 +0800

    net/procfs: disable tcp/udp proc node if no stack available
    
    Signed-off-by: chao an <an...@xiaomi.com>
---
 net/procfs/net_procfs.c | 4 ++--
 net/procfs/net_tcp.c    | 4 ++--
 net/procfs/net_udp.c    | 4 ++--
 net/procfs/procfs.h     | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/net/procfs/net_procfs.c b/net/procfs/net_procfs.c
index bd862fef63..5e8f208d15 100644
--- a/net/procfs/net_procfs.c
+++ b/net/procfs/net_procfs.c
@@ -124,7 +124,7 @@ static const struct netprocfs_entry_s g_net_entries[] =
     }
   },
 #  endif
-#  ifdef CONFIG_NET_TCP
+#  if defined(CONFIG_NET_TCP) && !defined(CONFIG_NET_TCP_NO_STACK)
   {
     DTYPE_FILE, "tcp",
     {
@@ -132,7 +132,7 @@ static const struct netprocfs_entry_s g_net_entries[] =
     }
   },
 #  endif
-#  ifdef CONFIG_NET_UDP
+#  if defined(CONFIG_NET_UDP) && !defined(CONFIG_NET_UDP_NO_STACK)
   {
     DTYPE_FILE, "udp",
     {
diff --git a/net/procfs/net_tcp.c b/net/procfs/net_tcp.c
index dc779aa0d2..c3962d686d 100644
--- a/net/procfs/net_tcp.c
+++ b/net/procfs/net_tcp.c
@@ -41,7 +41,7 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-#ifdef CONFIG_NET_TCP
+#if defined(CONFIG_NET_TCP) && !defined(CONFIG_NET_TCP_NO_STACK)
 
 #ifdef CONFIG_NET_IPv6
 #  define TCP_LINELEN 180
@@ -215,4 +215,4 @@ ssize_t netprocfs_read_tcpstats(FAR struct netprocfs_file_s *priv,
   return len;
 }
 
-#endif /* CONFIG_NET_TCP */
+#endif /* CONFIG_NET_TCP && !CONFIG_NET_TCP_NO_STACK */
diff --git a/net/procfs/net_udp.c b/net/procfs/net_udp.c
index d78faf276e..0dab03b68a 100644
--- a/net/procfs/net_udp.c
+++ b/net/procfs/net_udp.c
@@ -41,7 +41,7 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-#ifdef CONFIG_NET_UDP
+#if defined(CONFIG_NET_UDP) && !defined(CONFIG_NET_UDP_NO_STACK)
 
 #ifdef CONFIG_NET_IPv6
 #  define UDP_LINELEN 180
@@ -206,4 +206,4 @@ ssize_t netprocfs_read_udpstats(FAR struct netprocfs_file_s *priv,
   return len;
 }
 
-#endif /* CONFIG_NET_UDP */
+#endif /* CONFIG_NET_UDP && !CONFIG_NET_UDP_NO_STACK */
diff --git a/net/procfs/procfs.h b/net/procfs/procfs.h
index fb4a2cf1bc..39ad93e36d 100644
--- a/net/procfs/procfs.h
+++ b/net/procfs/procfs.h
@@ -182,7 +182,7 @@ ssize_t netprocfs_read_mldstats(FAR struct netprocfs_file_s *priv,
  *
  ****************************************************************************/
 
-#ifdef CONFIG_NET_TCP
+#if defined(CONFIG_NET_TCP) && !defined(CONFIG_NET_TCP_NO_STACK)
 ssize_t netprocfs_read_tcpstats(FAR struct netprocfs_file_s *priv,
                                 FAR char *buffer, size_t buflen);
 #endif
@@ -205,7 +205,7 @@ ssize_t netprocfs_read_tcpstats(FAR struct netprocfs_file_s *priv,
  *
  ****************************************************************************/
 
-#ifdef CONFIG_NET_UDP
+#if defined(CONFIG_NET_UDP) && !defined(CONFIG_NET_UDP_NO_STACK)
 ssize_t netprocfs_read_udpstats(FAR struct netprocfs_file_s *priv,
                                 FAR char *buffer, size_t buflen);
 #endif