diff --git a/include/nuttx/net/netconfig.h b/include/nuttx/net/netconfig.h index 46313631b66..cac0b0efeec 100644 --- a/include/nuttx/net/netconfig.h +++ b/include/nuttx/net/netconfig.h @@ -2,7 +2,8 @@ * include/nuttx/net/netconfig.h * * SPDX-License-Identifier: BSD-3-Clause - * SPDX-FileCopyrightText: 2007, 2011, 2014-2015, 2017-2019 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2007, 2011, 2014-2015, 2017-2019 Gregory Nutt. + * All rights reserved. * SPDX-FileCopyrightText: 2001-2003, Adam Dunkels. All rights reserved. * SPDX-FileContributor: Gregory Nutt * SPDX-FileContributor: Adam Dunkels @@ -67,9 +68,9 @@ * matter. It should, however, be valid in the current configuration. */ -#if defined(CONFIG_NET_IPv4) +#if defined(HAVE_PFINET_SOCKETS) # define NET_SOCK_FAMILY AF_INET -#elif defined(CONFIG_NET_IPv6) +#elif defined(HAVE_PFINET6_SOCKETS) # define NET_SOCK_FAMILY AF_INET6 #elif defined(CONFIG_NET_LOCAL) # define NET_SOCK_FAMILY AF_LOCAL diff --git a/libs/libc/net/lib_indextoname.c b/libs/libc/net/lib_indextoname.c index bc6adcd850f..73d04b12cc0 100644 --- a/libs/libc/net/lib_indextoname.c +++ b/libs/libc/net/lib_indextoname.c @@ -29,6 +29,7 @@ #include #include +#include #include /**************************************************************************** diff --git a/libs/libc/net/lib_nametoindex.c b/libs/libc/net/lib_nametoindex.c index c8962a06c28..1e8c695f710 100644 --- a/libs/libc/net/lib_nametoindex.c +++ b/libs/libc/net/lib_nametoindex.c @@ -29,6 +29,7 @@ #include #include +#include #include /**************************************************************************** diff --git a/net/inet/inet.h b/net/inet/inet.h index b150ab1ab64..d8b56dfe961 100644 --- a/net/inet/inet.h +++ b/net/inet/inet.h @@ -47,11 +47,13 @@ #if defined(CONFIG_NET_IPv4) || defined(CONFIG_NET_IPv6) # define HAVE_INET_SOCKETS -# if defined(CONFIG_NET_IPv4) +# if (defined(CONFIG_NET_IPv4) && (defined(NET_UDP_HAVE_STACK) || \ + defined(NET_TCP_HAVE_STACK))) || defined(CONFIG_NET_ICMP_SOCKET) # define HAVE_PFINET_SOCKETS # endif -# if defined(CONFIG_NET_IPv6) +# if (defined(CONFIG_NET_IPv6) && (defined(NET_UDP_HAVE_STACK) || \ + defined(NET_TCP_HAVE_STACK))) || defined(CONFIG_NET_ICMPv6_SOCKET) # define HAVE_PFINET6_SOCKETS # endif #endif diff --git a/net/socket/net_sockif.c b/net/socket/net_sockif.c index 4925bc19cec..1eaca8fc6d3 100644 --- a/net/socket/net_sockif.c +++ b/net/socket/net_sockif.c @@ -76,7 +76,7 @@ net_sockif(sa_family_t family, int type, int protocol) switch (family) { -#ifdef HAVE_INET_SOCKETS +#if defined(HAVE_PFINET_SOCKETS) || defined(HAVE_PFINET6_SOCKETS) # ifdef HAVE_PFINET_SOCKETS case PF_INET: # endif