net/procfs: disable tcp/udp proc node if no stack available

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an 2022-09-19 12:36:15 +08:00 committed by Xiang Xiao
parent 3461990ef4
commit f286012c0d
4 changed files with 8 additions and 8 deletions

View File

@ -124,7 +124,7 @@ static const struct netprocfs_entry_s g_net_entries[] =
} }
}, },
# endif # endif
# ifdef CONFIG_NET_TCP # if defined(CONFIG_NET_TCP) && !defined(CONFIG_NET_TCP_NO_STACK)
{ {
DTYPE_FILE, "tcp", DTYPE_FILE, "tcp",
{ {
@ -132,7 +132,7 @@ static const struct netprocfs_entry_s g_net_entries[] =
} }
}, },
# endif # endif
# ifdef CONFIG_NET_UDP # if defined(CONFIG_NET_UDP) && !defined(CONFIG_NET_UDP_NO_STACK)
{ {
DTYPE_FILE, "udp", DTYPE_FILE, "udp",
{ {

View File

@ -41,7 +41,7 @@
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_NET_TCP #if defined(CONFIG_NET_TCP) && !defined(CONFIG_NET_TCP_NO_STACK)
#ifdef CONFIG_NET_IPv6 #ifdef CONFIG_NET_IPv6
# define TCP_LINELEN 180 # define TCP_LINELEN 180
@ -215,4 +215,4 @@ ssize_t netprocfs_read_tcpstats(FAR struct netprocfs_file_s *priv,
return len; return len;
} }
#endif /* CONFIG_NET_TCP */ #endif /* CONFIG_NET_TCP && !CONFIG_NET_TCP_NO_STACK */

View File

@ -41,7 +41,7 @@
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_NET_UDP #if defined(CONFIG_NET_UDP) && !defined(CONFIG_NET_UDP_NO_STACK)
#ifdef CONFIG_NET_IPv6 #ifdef CONFIG_NET_IPv6
# define UDP_LINELEN 180 # define UDP_LINELEN 180
@ -206,4 +206,4 @@ ssize_t netprocfs_read_udpstats(FAR struct netprocfs_file_s *priv,
return len; return len;
} }
#endif /* CONFIG_NET_UDP */ #endif /* CONFIG_NET_UDP && !CONFIG_NET_UDP_NO_STACK */

View File

@ -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, ssize_t netprocfs_read_tcpstats(FAR struct netprocfs_file_s *priv,
FAR char *buffer, size_t buflen); FAR char *buffer, size_t buflen);
#endif #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, ssize_t netprocfs_read_udpstats(FAR struct netprocfs_file_s *priv,
FAR char *buffer, size_t buflen); FAR char *buffer, size_t buflen);
#endif #endif