summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-01-27 14:11:46 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-01-27 14:11:46 -0600
commit679244ccea82868acb86ef68fe550cb65c475c5c (patch)
treeaa783282c4c9c3d61628765e9231b7fc4462c58a
parenta62b97e36baab287c8bb412455b042d7274e567f (diff)
downloadnuttx-679244ccea82868acb86ef68fe550cb65c475c5c.tar.gz
nuttx-679244ccea82868acb86ef68fe550cb65c475c5c.tar.bz2
nuttx-679244ccea82868acb86ef68fe550cb65c475c5c.zip
Various fixes to get Unix domain sockets to build on the simulator without Ethernet
-rw-r--r--apps/nshlib/nsh_netinit.c2
-rw-r--r--nuttx/arch/sim/src/Makefile2
-rw-r--r--nuttx/include/nuttx/net/netconfig.h10
-rw-r--r--nuttx/net/socket/connect.c3
4 files changed, 13 insertions, 4 deletions
diff --git a/apps/nshlib/nsh_netinit.c b/apps/nshlib/nsh_netinit.c
index ed42bb9ba..5a96aed6c 100644
--- a/apps/nshlib/nsh_netinit.c
+++ b/apps/nshlib/nsh_netinit.c
@@ -107,7 +107,7 @@
# ifndef CONFIG_NSH_NOMAC
# error "CONFIG_NSH_NOMAC must be defined for SLIP"
# endif
-#else
+#elif !defined(CONFIG_NET_LOCAL)
# error ERROR: No link layer protocol defined
#endif
diff --git a/nuttx/arch/sim/src/Makefile b/nuttx/arch/sim/src/Makefile
index 4507ce60d..0fd5bfea9 100644
--- a/nuttx/arch/sim/src/Makefile
+++ b/nuttx/arch/sim/src/Makefile
@@ -98,7 +98,7 @@ ifeq ($(CONFIG_ARCH_ROMGETC),y)
CSRCS += up_romgetc.c
endif
-ifeq ($(CONFIG_NET),y)
+ifeq ($(CONFIG_NET_ETHERNET),y)
CSRCS += up_netdriver.c
HOSTCFLAGS += -DNETDEV_BUFSIZE=$(CONFIG_NET_ETH_MTU)
ifneq ($(HOSTOS),Cygwin)
diff --git a/nuttx/include/nuttx/net/netconfig.h b/nuttx/include/nuttx/net/netconfig.h
index fed4f4ada..58e285b5f 100644
--- a/nuttx/include/nuttx/net/netconfig.h
+++ b/nuttx/include/nuttx/net/netconfig.h
@@ -148,7 +148,7 @@
# define MIN_NET_DEV_MTU CONFIG_NET_SLIP_MTU
# define MAX_NET_DEV_MTU CONFIG_NET_SLIP_MTU
-#else /* if defined(CONFIG_NET_ETHERNET) */
+#elif defined(CONFIG_NET_ETHERNET)
/* Assume standard Ethernet link layer header */
# define NET_LL_HDRLEN(d) 14
@@ -156,6 +156,14 @@
# define MIN_NET_DEV_MTU CONFIG_NET_ETH_MTU
# define MAX_NET_DEV_MTU CONFIG_NET_ETH_MTU
+#else
+ /* Perhaps only Unix domain sockets */
+
+# define NET_LL_HDRLEN(d) 0
+# define NET_DEV_MTU(d) 0
+# define MIN_NET_DEV_MTU 0
+# define MAX_NET_DEV_MTU 0
+
#endif /* MULTILINK or SLIP or ETHERNET */
/* Layer 3/4 Configuration Options ******************************************/
diff --git a/nuttx/net/socket/connect.c b/nuttx/net/socket/connect.c
index 88535210a..0cb84177d 100644
--- a/nuttx/net/socket/connect.c
+++ b/nuttx/net/socket/connect.c
@@ -45,6 +45,7 @@
#include <stdint.h>
#include <errno.h>
+#include <assert.h>
#include <debug.h>
#include <arch/irq.h>
@@ -461,7 +462,7 @@ int psock_connect(FAR struct socket *psock, FAR const struct sockaddr *addr,
socklen_t addrlen)
{
FAR const struct sockaddr_in *inaddr = (FAR const struct sockaddr_in *)addr;
-#if defined(CONFIG_NET_TCP) || defined(CONFIG_NET_UDP)
+#if defined(CONFIG_NET_TCP) || defined(CONFIG_NET_UDP) || defined(CONFIG_NET_LOCAL)
int ret;
#endif
int err;