From f286012c0d3e468507af87662fac839850289ff1 Mon Sep 17 00:00:00 2001 From: chao an Date: Mon, 19 Sep 2022 12:36:15 +0800 Subject: [PATCH] net/procfs: disable tcp/udp proc node if no stack available Signed-off-by: chao an --- 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