Various fixes to get Unix domain sockets to build on the simulator without Ethernet

This commit is contained in:
Gregory Nutt 2015-01-27 14:11:46 -06:00
parent 095abf04c1
commit cbf0608513
3 changed files with 12 additions and 3 deletions

View File

@ -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)

View File

@ -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 ******************************************/

View File

@ -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;